Update README.md

This commit is contained in:
Colby 2024-04-10 23:34:50 +02:00 committed by GitHub
parent 80003b532c
commit 32fb8fff29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,2 +1,45 @@
# TechPaste
A simple Pastebin.
TechPaste is a simple pastebin software that uses client side encryption for web based usage, and server side encryption for API usage.
## Installation
Clone the repository and install the dependencies:
git clone https://github.com/yourusername/pasteapi.git
cd pasteapi
pip install -r requirements.txt
## API Usage
### Create a new paste
To create a new paste, send a POST request to `/api/v1/secure-paste` with a JSON body containing the `data` field. You can also include an optional `expiry` field to specify when the paste should expire.
curl -X POST -H "Content-Type: application/json" -d '{"data":"Hello, World!", "expiry":"2022-12-31 23:59:59"}' curl -X POST -H "Content-Type: application/json" -d '{"data":"Hello, World!", "expiry":"2022-12-31 23:59:59"}' http://localhost:5000/api/v1/secure-paste
The response will be a JSON object with a `success` field and, if the request was successful, an `id` field containing the id of the created paste.
### Retrieve a paste
To retrieve a paste, send a GET request to `/api/v1/secure-paste/{paste_id}`, replacing `{paste_id}` with the id of the paste.
curl -X GET http://localhost:5000/api/v1/secure-paste/1234567890
The response will be the content of the paste if it exists and has not expired. If the paste does not exist or has expired, the response will be an error message.
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
## License
Please replace `localhost:5000` and `yourusername` with the actual server address and port where your application is running and your actual GitHub username respectively.