A RESTful API for querying and saving planet dump's metadata.
Checkout the OpenAPI spec here
uuid-ossp extension must be installed in the database before you run the migrations.
don't forget to run migrations before you start the app
Just run the following command
npm run migration:runBuild the migrations image
docker build -t dump-server-migrations:latest -f migrations.Dockerfile .then simply run
docker run -it --rm --network host dump-server-migrations:latestIf you want to change the connection properties you can do it via either:
- Env variables
- Inject a config file based on your environment
Via env variables
docker run -it -e DB_USERNAME=VALUE -e DB_PASSWORD=VALUE -e DB_NAME=VALUE -e DB_TYPE=VALUE -e DB_HOST=VALUE -e DB_PORT=VALUE --rm --network host dump-server-migrations:latestVia injectiong a config file, assuming you want to run the migrations on your production
production.json:
{
"openapiConfig": {
"filePath": "./openapi3.yaml",
"basePath": "/docs",
"rawPath": "/api",
"uiPath": "/api"
},
"logger": {
"level": "info"
},
"server": {
"port": "8080"
},
"db": {
"type": "postgres",
"host": "localhost",
"port": 5432,
"username": "prod_avi",
"password": "prod_avi",
"database": "prod_avi"
}
}docker run -it --rm -e NODE_ENV=production --network host -v /path/to/proudction.json:/usr/app/config/production.json dump-server-migrations:latestnpm install
npm starttest against a postgres db
DB_TYPE=postgres DB_HOST=VALUE DB_PORT=VALUE DB_USERNAME=VALUE DB_NAME=VALUE DB_PASSWORD=VALUE npm run test:integrationnpm run test:unit