- Golang w/ Echo and Pgxpool
- Typescript w/ NextJS, TailwindCSS, PrismJS, SWR and React-Hook-Form
-
Get PostgreSQL setup
-
Rename .env.example to .env, and change
DATABASE_URL
to your Postgres connection DSN, andSERVER_URL
, to what URL you plan to access the API from, for exampleapi.paste.sysnomid.com
. -
Get Golang and NodeJS setup, and then run
make p-install
orgo get ./... && cd web && npm i
. -
For a Production Environment run
make p-start
orgo build -o main && ./main & cd web && npm run build && npm run start && fg
-
For a Development Environment run
make p-dev
orair & cd web && npm run dev && fg
Run make docker
or docker build -t sysnomid_paste_server . && docker run -dp 4300:4300 sysnomid_paste_server
to get a container with the paste API.
API Base URL = https://api.paste.sysnomid.com
Used to Create a Paste.
Example cURL:
All fields listed are required except for expires_at
.
If the request went through without error, you will receive a unique id that you can then access your paste from.
List of supported languages are available at create.sql
To specify an expiry date, use the TIMESTAMP WITH TIME ZONE
format, (https://www.postgresql.org/docs/9.1/datatype-datetime.html)
Example - 2030-04-23 01:10
Used to access pastes and their associated data in JSON.
Example Response:
{
"ID": 10765432100123456789,
"Title": "Untitled",
"CreatedAt": "2021-04-18T19:45:01.406173Z",
"Language": "none",
"LanguageDisplayName": "Plaintext"
}
Used to get the body of a paste in plaintext.