This is an Express.js application. The Express.js webserver is defined in /src/bin/index.js
, tucked out the way. The web-server loads and serves the Express.js application - the application root is ./src/app.js
You need to have Docker and Node.js installed on your machine, then run the following commands / do the following steps:
docker run -p 5432:5432 --name postgis -v postgres11:/var/lib/postgresql/data -e POSTGRES_PASSWORD=password -d mdillon/postgis
(And sometimes you need to restart the container on computer start up - use this command docker container start postgis
)
(This is easiest to do with DBeaver, but any PostgreSQL client should work)
- Create a DB called
seacrifog_old
- Restore
./src/db/seacrifog-protoype.backup
to this database
npm install
echo FORCE_DB_RESET=true > .env
npm start
Go to http://localhost:3000
- Configure a Postgis database server somewhere
- Add a
.env
file with production-sensible values (refer to notes below on "Configuration") - Start the app:
npm run start:prod
This is a sample of the environment variables that the app requires to run - specifically in the context of a .env
file (with the default values shown).
PORT=3000
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:3001
POSTGRES_HOST=localhost
POSTGRES_USER=postgres
POSTGRES_DATABASE=seacrifog
POSTGRES_PASSWORD=password
POSTGRES_PORT=5432
FORCE_DB_RESET=false