This is a REST API and Displays directories on the fileystem.
npm install && npm run start
This is a ECMAScript 2015+ implementation using node 12+ with the relatively recent Node support ESM import
syntax.
We use a classic Express routing pattern with query string parameters and typical REST HTTP verbs.
There is no database; persistence is managed with the filesystem using async Node fs
operations.
We use docker to package the container, with a minimalist Dockerfile.
- Build:
docker build -t <repository>/<image_name> .
- Run:
docker run -p 49160:8080 -d <repository>/<image_name>
- View processes:
docker ps
- Cleanup containers:
docker kill $(docker ps -q)
Install dependencies: npm install
Run with livereloading using nodemon: npm start
which uses nodemon for livereloading.
Management scripts are defined in package.json.
The test suite is managed with Mocha using a BDD sytax.
The existing tests are a good representation of feature coverage provided by the API.
Each API endpoint is fully documented with inline JSDoc comments (in [src/server.js]) and a we use Swagger UI Express to build a Swagger spec and render a Swagger UI at /api-docs
.