Search…
Web

About

The web consolidates content from multiple sources and displays it in a user friendly way.

URLs

Getting started

First off: Configure which API to fetch data from.

Mock API (no server)

Add API_MOCKS=true to your .env, or export API_MOCKS=true to your .env.secret file.
You can tweak the mock data in libs/api/mocks.

Local API server

The web depends on the cms and content-search domains of the API these in turn depend on Elasticsearch. Hence we have to have Elasticsearch running on our machine for these domains to function as expected. The recommended approach to running Elasticsearch on your machine depends on what you want to work on:
If you want to work on the cms or content-search domains such as add models or alter Elasticsearch queries it's recommended you run Elasticsearch locally you can find further instructions on how to achieve this under search-indexer dev-services section.
If you just want to run the API to have access to real data you can run the Elasticsearch proxy server, this gives you access to the elasticsearch instance of the dev environment (this is prefered since the proxy uses less resources than the local instance of Elasticsearch).
To access elasticsearch instance from dev environment:
  1. 1.
    Login here https://island-is.awsapps.com/start#/ (Contact devops if you need access)
  2. 2.
    Copy env variables as instructed here (image arrows 1,2,3)
  3. 3.
    Paste env variables into terminal
  4. 4.
    Run ./scripts/run-es-proxy.sh from island.is root
  5. 5.
    You have success if you see Forwarding from 0.0.0.0:9200 -> 9200 in terminal
Caveats:
  • You need to have docker installed and running
  • You have to refresh your AWS env variables every 8 hours
1
yarn start api
Copied!
You must have env variables for the cms and content-search domains for the website to work as expected.
These are:
  • CONTENTFUL_HOST= - Get from Contentful (depends on whether you use prod or preview tokens)
  • CONTENTFUL_ACCESS_TOKEN= - Get from Contentful or by running yarn get-secrets api
  • CONTENTFUL_MANAGEMENT_ACCESS_TOKEN= - Get from Contentful (only used when generating models from Contentful in API)
    ELASTIC_NODE=http://localhost:9200/

Start the web server

You can start the web server by running:
1
yarn start web
Copied!
This starts a server on localhost:4200

Further Documentation

Subpages - Information on Layouts and Components used when creating subpages for the web.

Code owners and maintainers

Last modified 5mo ago