The web consolidates content from multiple sources and displays it in a user friendly way.
First off: Configure which API to fetch data from.
API_MOCKS=true to your
export API_MOCKS=true to your
You can tweak the mock data in
The web depends on the
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
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:
Login here https://island-is.awsapps.com/start#/ (Contact devops if you need access)
Copy env variables as instructed here (image arrows 1,2,3)
Paste env variables into terminal
./scripts/run-es-proxy.sh from island.is root
You have success if you see
Forwarding from 0.0.0.0:9200 -> 9200 in terminal
You need to have docker installed and running
You have to refresh your AWS env variables every 8 hours
yarn start api
You must have env variables for the
content-search domains for the website to work as expected.
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)
You can start the web server by running:
yarn start web
This starts a server on
Subpages - Information on Layouts and Components used when creating subpages for the web.