-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
113 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# API | ||
|
||
## Create a paste | ||
|
||
### Request | ||
|
||
**Method:** `POST /api/paste` | ||
|
||
#### Body | ||
|
||
| Name | Type | Description | Required | | ||
| ---- | ---- | ----------- | -------- | | ||
| `content` | `string` | Paste content. If encrypted, must be encoded into a string (preferably Base64). | Yes | | ||
| `config` | `object` | Configuration for the paste | No | | ||
| `passwordProtected` | `boolean` | Whether the paste is password protected. | No | | ||
| `initVector` | `string` | Initialization vector for AES encryption. Max length: 64. | No | | ||
|
||
**Config Object:** | ||
|
||
| Name | Type | Description | Required | | ||
| ---- | ---- | ----------- | -------- | | ||
| `language` | `string` | Programming language of the paste. Default: `plaintext`. | No | | ||
| `encrypted` | `boolean` | Whether the paste is encrypted. Default: `false`. | No | | ||
| `expiresAfter` | `number` | Time in seconds until the paste expires. | No | | ||
| `burnAfterRead` | `boolean` | Whether the paste is deleted after reading. | No | | ||
|
||
### Examples | ||
|
||
```json | ||
{ | ||
"content": "i0n3PW6qDUhDaTrzoKg+/ip4qQwu+iq8/fWDVg==", | ||
"config": { | ||
"language": "plaintext", | ||
"encrypted": true, | ||
"expiresAfter": 3600, | ||
"burnAfterRead": false | ||
}, | ||
"passwordProtected": false, | ||
"initVector": "27DIWK00yDiGx001" | ||
} | ||
``` | ||
|
||
```json | ||
{ | ||
"content": "Hello World!", | ||
"config": { | ||
"language": "plaintext" | ||
} | ||
} | ||
``` | ||
|
||
## Get a paste | ||
|
||
### Request | ||
|
||
**Method:** `GET /api/paste` | ||
|
||
#### Query Parameters | ||
|
||
| Name | Type | Description | Required | | ||
| ---- | ---- | ----------- | -------- | | ||
| `key` | `string` | Paste key. | Yes | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "yabin", | ||
"version": "0.0.1", | ||
"version": "1.0.0", | ||
"private": true, | ||
"scripts": { | ||
"dev": "vite dev", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,17 +88,25 @@ | |
href="https://github.com/Yureien/YABin">open-source</a | ||
> and easily self-hostable. | ||
</li> | ||
<li>It can even be run in serverless environments!</li> | ||
</ul> | ||
|
||
<p class="mt-4"> | ||
The API documentation is available <a | ||
class="underline underline-offset-2" | ||
href="https://github.com/Yureien/YABin/blob/main/API.md">here</a | ||
>. | ||
</p> | ||
</div> | ||
|
||
<div class="mt-8"> | ||
<h1 class="text-4xl">Support the development</h1> | ||
<p class="text-lg mt-2"> | ||
<p class="mt-2"> | ||
If you really like this project, I'd love it if you <a | ||
href="https://ko-fi.com/A0A21C34E" | ||
target="_blank" | ||
><img | ||
class="border-0 inline h-10" | ||
class="border-0 inline h-8" | ||
src="https://storage.ko-fi.com/cdn/kofi3.png?v=3" | ||
alt="Buy Me a Coffee at ko-fi.com" | ||
/></a | ||
|
@@ -107,13 +115,16 @@ | |
<iframe | ||
src="https://github.com/sponsors/Yureien/button" | ||
title="Sponsor Yureien" | ||
class="border-0 rounded h-10 inline w-32" | ||
class="border-0 rounded h-8 inline w-28" | ||
/> me on GitHub. | ||
</p> | ||
<p class="text-lg mt-4"> | ||
Soon, after the development is mostly complete, I will be running managed servers on a | ||
custom and short domain. You can also support me by subscribing to a monthly service, and | ||
you get your own pastebin, with your custom styles, colours, text and more! | ||
<p class="text mt-4"> | ||
Soon, I will be running managed servers on a custom and short domain. You can support me by | ||
subscribing to a monthly service, and you get your own pastebin, with your custom styles, | ||
colours, text and more! If you are interested, please send me an email at <a | ||
class="underline underline-offset-2" | ||
href="mailto:[email protected]">[email protected]</a | ||
>, and I will get back to you as soon as possible. | ||
</p> | ||
</div> | ||
</div> | ||
|
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.