Optimize HTTP Server


Running Locally

  1. Clone this repo.
git clone git@github.com:devansh016/http-server-assignment.git
  1. Build the Docker Image
docker build -t optimise-http-server .
  1. Run the Docker Image
docker run -p 8080:8080 --memory=1500m --cpus=2 optimise-http-server
  1. The application will be running on port 8080.

Optimisation

Used fs.createReadStream instead of fs.readFile to optimise the performance as the file are large in size ~100MB.

Postman Example

https://i.ibb.co/dDPSL05/Screenshot-2024-01-26-165054.png