mirror of
				https://github.com/okiba-org/backend.git
				synced 2025-11-03 18:27:13 +00:00 
			
		
		
		
	docs: add readme
This commit is contained in:
		
							
								
								
									
										27
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								README.md
									
									
									
									
									
										Normal 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
 | 
			
		||||
```
 | 
			
		||||
@@ -4,17 +4,19 @@
 | 
			
		||||
    "description": "",
 | 
			
		||||
    "main": "index.js",
 | 
			
		||||
    "scripts": {
 | 
			
		||||
    "dev": "ts-node-dev src/main.ts"
 | 
			
		||||
        "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",
 | 
			
		||||
    "@types/cors": "^2.8.12",
 | 
			
		||||
        "typescript": "^4.7.4"
 | 
			
		||||
    },
 | 
			
		||||
    "dependencies": {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user