/nirvana

Nirvana - Custom Take-home Project

Primary LanguageTypeScriptMIT LicenseMIT

Nirvana - Custom Take-home Project

Contributors Forks Stargazers Issues MIT License LinkedIn

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Documentation
  5. License
  6. Contact
  7. Acknowledgements

About The Project

This is the solution to the "Custom Take-home Project" for Nirvana.

The project details are not included.

Built With

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.

Getting Started

You can the run the source code directly, using an npm script, or build the project and run it with node.

From Source

Install all dependencies:

npm install

Run the cli task:

npm run cli

From build

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:

  1. dist/esbuild
  2. 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

Usage

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

Documentation

The documentation site is generated by TypeDoc:

Link

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Your Name - @guzmonne - email@example.com

Project Link: https://github.com/guzmonne/nirvana

Acknowledgements