Table of Contents
This is the solution to the "Custom Take-home Project" for Nirvana.
The project details are not included.
The project was built using vanilla Node.JS to keep it as simple as possible. The only external library used is node-fetch
.
All the dependencies included in the project are used to build or test the project.
You can the run the source code directly, using an npm
script, or build the project
and run it with node
.
Install all dependencies:
npm install
Run the cli
task:
npm run cli
Install all dependencies:
npm install
Run the build-all
task:
npm run build-all
This will create a directory called dist
with two sub-directories:
dist/esbuild
dist/tsc
The first one has a minified version of the API, while the second one just has the JavaScript code compiled from TypeScript source. You can reun either version to start the API:
# Minified version
node dist/esbuild/cli.js
# Compiled version
node dist/tsc/cli.js
To configure the API you have to set up the following environment variables:
Name | Default | Description |
---|---|---|
PORT |
3000 |
Port where the server will listen for requests. |
EXTERNAL_APIS |
null |
List of external APIs separated by a comma (, ). |
For example:
export PORT=3000
export EXTERNAL_APIS=https://api1.com,https://api2.com,https://api3.com
npm run cli
The documentation site is generated by TypeDoc:
Distributed under the MIT License. See LICENSE
for more information.
Your Name - @guzmonne - email@example.com
Project Link: https://github.com/guzmonne/nirvana