docs: add readme

This commit is contained in:
alok8bb 2022-07-19 23:21:37 +05:30
parent e0d867fe30
commit e2d08e83ab
No known key found for this signature in database
GPG Key ID: 748A8580B906551C
2 changed files with 54 additions and 25 deletions

27
README.md Normal file
View File

@ -0,0 +1,27 @@
# Okiba
A simple paste bin written in nodejs with postgresql.
## Usage
Before starting the server, we populate the database by creating a table for endpoints and providing the words to be used. The server will be populated from `words.txt` file from project root.
### Environment Variables
Create a `.env` file at the project root and add the following variables according to the database.
```shell
PORT = 8080
PGUSER = alok-pg
PGHOST = localhost
PGDATABASE = okiba
PGPORT = 5432
```
### Start scripts
```shell
// Development Server
$ pnpm run dev
// Build
$ pnpm build
// Production
$ pnpm start
```

View File

@ -1,27 +1,29 @@
{ {
"name": "okiba", "name": "okiba",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"dev": "ts-node-dev src/main.ts" "dev": "ts-node-dev src/main.ts",
}, "build": "pnpm install && tsc",
"keywords": [], "start": "node public/main.js"
"author": "", },
"license": "ISC", "keywords": [],
"devDependencies": { "author": "",
"@types/express": "^4.17.13", "license": "ISC",
"@types/node": "^18.0.3", "devDependencies": {
"@types/pg": "^8.6.5", "@types/cors": "^2.8.12",
"ts-node-dev": "^2.0.0", "@types/express": "^4.17.13",
"@types/cors": "^2.8.12", "@types/node": "^18.0.3",
"typescript": "^4.7.4" "@types/pg": "^8.6.5",
}, "ts-node-dev": "^2.0.0",
"dependencies": { "typescript": "^4.7.4"
"chalk": "^4.1.2", },
"cors": "^2.8.5", "dependencies": {
"dotenv": "^16.0.1", "chalk": "^4.1.2",
"express": "^4.18.1", "cors": "^2.8.5",
"pg": "^8.7.3" "dotenv": "^16.0.1",
} "express": "^4.18.1",
"pg": "^8.7.3"
}
} }