oapen-suggestion-service/api
Justin O'Boyle f4b9ed39ab
Embed script deployment fixes (#37)
* Don't EncodeURIComponent

* Fix CORS

* Explicitly define CORS header
2023-03-03 09:13:53 -05:00
..
db OAP-54: Full harvest for DB, add threshold (#34) 2023-02-23 19:23:23 -05:00
.gitignore OAP-40 Align API more closely with ngram generation, fix environment (#21) 2022-11-14 15:20:43 -05:00
Dockerfile Setup docker (#26) 2022-12-13 07:46:08 -05:00
README.md OAP-54: Full harvest for DB, add threshold (#34) 2023-02-23 19:23:23 -05:00
app.js Embed script deployment fixes (#37) 2023-03-03 09:13:53 -05:00
config.env OAP-17: PostgreSQL integration into API with pg-promise, data function to read from DB, dotenv to read DB credentials from environment variables (#9) 2022-10-26 03:07:10 +00:00
package-lock.json OAP-38: Add /ngrams endpoint to API (#19) 2022-11-09 18:45:48 -05:00
package.json OAP-38: Add /ngrams endpoint to API (#19) 2022-11-09 18:45:48 -05:00
routes.js Embed script deployment fixes (#37) 2023-03-03 09:13:53 -05:00
validate.js Fixed minor error with handle validation (#33) 2023-02-09 16:46:22 +00:00

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