This repository holds the code for the API that powers Innsyn.no.
Before being able to setup we assume that Node.js, PostgreSQL and Chromium have been installed on your machine. If you use macOS all of the above can be installed using brew.
npm install
Before being able to run the app, for the first time, you will need to setup the database and database connection string. By default the database name is innsyn
running under the user postgres:postgres
(config can be found here). This value can be overriden by creating development.json
inside the config
folder with development.json.example as a base. You will also need to set the executable_path for Chromium which is included as an example in the latter file.
After this you can run the database migrations and seed the database by running:
node ./node_modules/bin/knex migrate:latest
node ./node_modules/bin/knex seed:run
IMPORTANT: Whenever you seed the database you will DESTORY all data in the database.
npm run start:web
Once the steps above have been succesfull you can crawl a site by running e.g:
node ./tasks/syncFromWeb.js aust-agder-fylkeskommune
- Knowledge of Objection.js
- Knowledge of Puppeteer
- Chromium
- PostgreSQL
- Node.js 10.*