Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

pz1971/text-paste

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

text-paste

1. Description

A simple web application to store text data and preview it with syntax highlighting. You can use it to store and share code snippets, notes, or anything else. Additionally, you can protect pastes with passwords and set expire time after which they will be deleted.

2. Features

  • Store and preview text data
  • Set expire time for each paste
  • Optionally set password
  • Syntax highlighting for different languages
  • For now it supports syntax highlighting for cpp, java, python and javascript codes
  • Download the paste as a file
  • Number of views for each paste

3. Technologies Used

Please go through the package.json file for more information.

Prism.js was used in the client side in paste.ejs file. You can find it in the views folder.

4. License

MIT

5. Installation and Testing

You can skip step 2, 3 if you set MONGO_URI environment variable in you machine.

  1. First you need to install the dependencies. To install the dependencies, run the following command:
npm install
  1. Then you need to create a file named 'env.js' in the root directory of the project. The contents of the file should be:
process.env.MONGO_URI="<mongodb connection string>";

replace <mongodb connection string> with the connection string for your mongodb database.

  1. Now you needd to uncomment the line in the file 'app.js'.
  2. To start the application, run the following command:
npm start

or you can run the following command to start the application in development mode:

npm run dev
  1. Create an issue here if you face any problem or have any suggestion.

6. Additional Information

  • 'app.js' file is the controller of the application.
  • 'views' folder contains all the views of the application.
  • 'models' folder contains database models.
  • 'public' folder contains all the static files used in client side.