From e2d08e83ab5cd55be1d856a8326b8c07c0167d02 Mon Sep 17 00:00:00 2001 From: alok8bb Date: Tue, 19 Jul 2022 23:21:37 +0530 Subject: [PATCH] docs: add readme --- README.md | 27 +++++++++++++++++++++++++++ package.json | 52 +++++++++++++++++++++++++++------------------------- 2 files changed, 54 insertions(+), 25 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..9596a6a --- /dev/null +++ b/README.md @@ -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 +``` \ No newline at end of file diff --git a/package.json b/package.json index 75606ac..2083d81 100644 --- a/package.json +++ b/package.json @@ -1,27 +1,29 @@ { - "name": "okiba", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "dev": "ts-node-dev src/main.ts" - }, - "keywords": [], - "author": "", - "license": "ISC", - "devDependencies": { - "@types/express": "^4.17.13", - "@types/node": "^18.0.3", - "@types/pg": "^8.6.5", - "ts-node-dev": "^2.0.0", - "@types/cors": "^2.8.12", - "typescript": "^4.7.4" - }, - "dependencies": { - "chalk": "^4.1.2", - "cors": "^2.8.5", - "dotenv": "^16.0.1", - "express": "^4.18.1", - "pg": "^8.7.3" - } + "name": "okiba", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "dev": "ts-node-dev src/main.ts", + "build": "pnpm install && tsc", + "start": "node public/main.js" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@types/cors": "^2.8.12", + "@types/express": "^4.17.13", + "@types/node": "^18.0.3", + "@types/pg": "^8.6.5", + "ts-node-dev": "^2.0.0", + "typescript": "^4.7.4" + }, + "dependencies": { + "chalk": "^4.1.2", + "cors": "^2.8.5", + "dotenv": "^16.0.1", + "express": "^4.18.1", + "pg": "^8.7.3" + } }