Affluent challenge
This challenge was made for Affluent.io following these instructions: https://docs.google.com/document/d/1M_oxIgZ1-I2tK7PxvNgHctplTbdk4RxsHjRZk7r3LjY/edit#
Challenge required to built a simple HTML website which previewed fetched from two different entities.
Users, from reqres. And Metrics from Affluent.
Get the latest version of node from the official website or using nvm.
Nvm approach is preferred.
Install dependencies by running npm i.
As there's no "production" environment i just left the script to run npm run dev, for debugging with nodemon. You could either start it that way or just run node server.js from the root folder.
After this access to the view file is available from localhost:8080 (if Port 8080 wasn't modified, in that case, use your favorite port )
If everything went well, you should be able to see something similar to this:
By default, the environment will be development. There's no production ENV.
PORT is set by default to 8080, feel free to change it from the .ENV file.
Dotenv is used for managing environment variables. They are stored in the /.env file. Take into account that the variables defined in the bashrc are not overrided.
The environment variables should be added to the .env file in the form of NAME=VALUE, as the following example:
PORT=8081
CLIENTS_API=http://api.clients.example.org/
Remember not to push nor commit the .env file.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Run the tests (
npm test) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request
This project was written and is maintained by German Bonin.
This project is licensed under the MIT License.