Skip to content

jarib/api

 
 

Repository files navigation

Innsyn

Introduction

This repository holds the code for the API that powers Innsyn.no.

Running it

Setup

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.

Installing dependencies

npm install

Starting the first time

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.

Staring the application

npm run start:web

Crawling a website

Once the steps above have been succesfull you can crawl a site by running e.g:

node ./tasks/syncFromWeb.js aust-agder-fylkeskommune

Requirements

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 94.0%
  • PLpgSQL 5.8%
  • Other 0.2%