/mobilsoeg

Mobil Søg

Primary LanguageJavaScript

Mobilsøg

GitHub tag David David Build Status Coverage Status Code Climate

As default the application will load on localhost:8080. Se a running example on ddbmobil.demo.dbc.dk

How to install and run the application

 # Prerequisites
npm install supervisor -g

 # Build and install the application
git clone https://github.com/DBCDK/mobilsoeg.git
npm install
npm run build

 # Start the application
npm run serve

 # Run in development mode (see also other targets in package.json)
npm run dev:remoteprofile

Environment Varibles

The following environment variables can be used to override default settings in the application

  • NPM_TOKEN Used to download private modules. THIS IS REQUIRED. You can find your npm token in ~/.npmrc The token has the following format: NPM_TOKEN=“00000000-0000-0000-0000-000000000000”

  • EMAIL_REDIRECT
    Used when a user creates a new account. The value given in EMAIL_REDIRECT will be used as basepath in the link that'll appear in the confirmation email sent to the user. Typically you'll want the value in EMAIL_REDIRECT to be the same as the basepath for the given site the user is signing up at. I.e pg.demo.dbc.dk.

    The default value is localhost

  • KAFKA_TOPIC
    (inherited from dbc-node-logger)
    This defines which topic in Kafka the log messages should be associated with

  • KAFKA_HOST
    (inherited from dbc-node-logger)
    String that defines the Zookeeper connectionstring. Should be defined as host:port. see winston-kafka-transport and dbc-node-logger

  • NEW_RELIC_APP_NAME
    This variable is used to configure the name with which the application should appear in New Relic but also elsewhere. Currently this value is also used to identify the application in logs and appended to secrets used in Redis.

    The default value is app_name

  • NODE_APPLICATION
    Use this varialbe to let the application how stylesheets are compiled and which jade templates are used. Currently two values are used to control compiling of SASS and delivering of templates:

    • pg Should be used when building Palles Gavebod
    • ddbmobil Should be used when building Mobil Søg

    The default value is pg

  • PORT
    Defines which portnumber the application should use when bootinh up. If PORT is undefined the application will be accecsible at port 8080 (i.e. localhost:8080)

    The default value is 8080

  • NODE_WEB_WORKERS Defines how many workers to use.

    The default value is 1

  • NODE_WEB_BROKERS Defines how many brokers to use.

    The default value is 1

  • AUTO_REBOOT Defines if a worker reboots on crash. (This does not apply to the whole application, just the workers).

    The default value is true

New Relic

As New Relic is used by DBC A/S this application requires New Relic to be configured.
If you want to run the application but can't provide a New Relic configuration you can start the application with NEW_RELIC_NO_CONFIG_FILE=true which will throw an error but wont crash your application.

Testing

Unit tests

Unit tests are placed with the modules and components in a tests folder to run the tests: npm run test

Selenium tests

The selenium tests (found in the /selenium directory) are integration tests, and mainly run in a chrome instance using ChromeDriver. to run tests: npm run selenium

If a SauceLabs account is available, you can set ENV variables SAUCE_USERNAME and SAUCE_ACCESS_KEY and then enable it in selenium_test.js