DataHub frontend in node.js.
Clone the repo, install dependencies using yarn (or npm), and run the server:
# or npm install
yarn install
npm start
We use .env file for loading environment variables. Please, use provided env.template as a template:
SITE_URL - FQ base URL of the site e.g. https://datahub.ioAPI_URL - FQ base URL of the API endpoint eg. https://api.datahub.ioBITSTORE_URL - base URL for the bitstore (pkgstore) e.g. https://pkgstore.datahub.ioWhen running locally, use test api address in .env:
API_URL=https://api-testing.datahub.io
BITSTORE_URL=https://pkgstore-testing.datahub.io
See the docs for more information.
The javascript portion of the app, which is responsible for rendering views, comes from a different repo. That repo must be submoduled in and then built:
git submodule init && git submodule update
To build the CSS:
Install sass
Run:
sass --watch public/sass:public/stylesheets
Now run the server:
export API_URL=https://api.datahub.io
export BITSTORE_URL=https://pkgstore.datahub.io
export dev=true
npm start
To run in watch mode:
# note the -e which means we watch for changes in templates too
nodemon -e "js html" index.js
To run tests (make sure all environment variables are set):
yarn test
We use Google Tag Manager to manage all tags (eg, google analytics, optimize and more) so instead of adding a new script into templates, you should consider editing via UI of Tag Manager.
Content type
Image
Digest
Size
602.6 MB
Last updated
over 7 years ago
docker pull datopian/frontend