535715932d
* basic config * Add github action * Fix makefile for linux and variable python (#27) * fix makefile * remove out * add to gitignore * Fix makefile for linux and variable python (#27) * fix makefile * remove out * add to gitignore * Fix dockerfile * stash changes * Make makefile dynamic (#28) * Remove broken docker packages for now * Add web * Make Black Formatter happy? Co-authored-by: Max Zaremba <max.zaremba@gmail.com> |
||
---|---|---|
.. | ||
db | ||
.gitignore | ||
Dockerfile | ||
README.md | ||
app.js | ||
config.env | ||
package-lock.json | ||
package.json | ||
routes.js | ||
validate.js |
README.md
OAPEN Suggestion API
About
A basic Node.js + Express api using pg-promise to interface with PostgreSQL and dotenv to read environment variables
Database Configuration
To configure the database connection, create a file called config.env
in api/
with the contents
DATABASE_URL="postgres://username:password@host:port/database"
PORT=PORT_NUMBER
e.g.
DATABASE_URL="postgres://postgres:password@localhost:5432/postgres"
PORT=3001
To populate the database with seed data, run make setup-env
from oapen-engine/
Running with npm
npm ci
npm start
Endpoints
-
Endpoint: /GET http://localhost:3001/api/{handle}
-
Endpoint: /GET http://localhost:3001/api/{handle}/ngrams