This repository was archived by the owner on Nov 21, 2024. It is now read-only.
File tree 4 files changed +39
-2
lines changed 4 files changed +39
-2
lines changed Original file line number Diff line number Diff line change
1
+ ## Installation
2
+
3
+ ```
4
+ # Clone and install deps
5
+ git clone https://github.com/anonymousthing/paradb-api.git
6
+ cd paradb-api
7
+ yarn
8
+
9
+ # Install and start postgres
10
+ sudo apt install postgresql
11
+ sudo service postgresql start
12
+
13
+ # Create postgres user for yourself
14
+ sudo -u postgres createuser --interactive --pwprompt
15
+
16
+ # Edit .env to fill out your username and password!
17
+
18
+ # Create db and instantiate schema
19
+ createdb paradb
20
+ db/init.sh
21
+
22
+ # Create symlink from "fe" to the actual frontend dist directory
23
+ ln -s /path/to/obento2/dist/paradb fe
24
+
25
+ # Start server
26
+ yarn start
27
+ ```
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ HERE=" $( realpath " ${0} " | xargs dirname) "
4
+
5
+ psql -d paradb -f " $HERE /init.sql"
6
+ psql -d paradb -f " $HERE /fake_data.sql"
Original file line number Diff line number Diff line change 1
- DROP TABLE maps;
1
+ DROP TABLE IF EXISTS maps;
2
2
CREATE TABLE maps (
3
3
id varchar (16 ) not null ,
4
4
title varchar (256 ) not null ,
@@ -10,7 +10,7 @@ CREATE TABLE maps (
10
10
album_art text
11
11
);
12
12
13
- DROP TABLE complexities;
13
+ DROP TABLE IF EXISTS complexities;
14
14
CREATE TABLE complexities (
15
15
map_id varchar (32 ) not null ,
16
16
complexity int not null ,
Original file line number Diff line number Diff line change 1
1
require ( 'dotenv' ) . config ( ) ;
2
2
3
+ if ( process . env . PGUSER == '' && process . env . PGPASSWORD == '' ) {
4
+ console . error ( 'PGUSER and PGPASSWORD have been left blank in .env -- intentional?' ) ;
5
+ }
6
+
3
7
import express from 'express' ;
4
8
import path from 'path' ;
5
9
import apiRouter from './api' ;
You can’t perform that action at this time.
0 commit comments