Pastebox is a simple and efficient pastebin service that allows users to store and share text snippets easily. It supports syntax highlighting, expiration dates for pastes, and a user-friendly interface.
- Syntax Highlighting: Automatically detects and highlights code syntax.
- Expiration Dates: Auto delete after 1 week.
- User-friendly Interface: Easy to use and navigate.
Check out the live demo: Pastebox Demo
To run Pastebox locally, follow these steps:
-
Clone the repository:
git clone https://github.com/priyans-hu/pastebox.git cd pastebox
-
Install dependencies:
npm install
-
Set up environment variables: Create a
.env
file in the root directory and add the following variables:PORT=3000 MONGODB_URI=your_mongodb_connection_string SECRET_KEY=your_secret_key
-
Start the server:
npm start
-
Visit: Open your browser and go to
http://localhost:3000
.
- Click on the "New Paste" button.
- Enter your text in the editor.
- Choose the syntax highlighting language.
- Click "Create Paste".
- Go to the URL of the paste (e.g.,
http://localhost:3000/paste/:id
). - View the text with syntax highlighting.
Pastebox provides a RESTful API for interacting with pastes.
- Create a Paste:
POST /api/pastes
- Get a Paste:
GET /api/pastes/:id
- Delete a Paste:
DELETE /api/pastes/:id
curl -X POST http://localhost:3000/api/pastes \
-H "Content-Type: application/json" \
-d '{"content":"Your code here", "syntax":"javascript", "expiration":"1d"}'
curl http://localhost:3000/api/pastes/:id
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
. - Make your changes and commit them:
git commit -m 'Add feature'
. - Push to the branch:
git push origin feature-name
. - Submit a pull request.
Pastebox is licensed under the MIT License. See the LICENSE file for more details.
For any questions or feedback, please reach out to:
- Priyanshu Garg
- GitHub: priyans-hu