A RESTful API for saving and querying OSM entities external id's
Checkout the OpenAPI spec here
if you are running a DB other than SQLite don't forget to run migrations before you start the app
Just run the following command
npm run migration:run
Build the migrations image
docker build -t id-2-osm-migrations:latest -f migrations.Dockerfile .
then simply run
docker run -it --rm --network host id-2-osm-migrations:latest
If 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 id-2-osm-migrations:latest
Via 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 id-2-osm-migrations:latest
npm install
npm start