- Chrome local host :-
- Docker terminal :-
- Docker container :-
-
Clone the repository to your local machine.
git clone https://github.com/aniket-24/Headout_Intern_Assignment.git
-
Install the required packages.
cd Headout_Intern_Assignment npm install
-
Start the development server.
node server.js
-
Open the project in your browser at
http://localhost:8080
to view your project.
You are tasked with implementing a simple HTTP server with the following requirements.
- Set up an HTTP server in a language/framework of your choice.
- The server should respond to incoming GET requests on the endpoint /data.
- You must accept 2 query params, n: file name, and m: line number.
- If n and line both are provided, return the content of file /tmp/data/n.txt at line number m.
- If only n is provided, return the contents of file /tmp/data/n.txt entirely.
- Each file should be around 100MB in size, there will be more than 30 different files (eg; 1.txt, 2.txt ... 30.txt โฆ n.txt).
- Request: /data?n=1&m=30
- Response: vyAF9kLDTIbqkv5R7hFqGDXaxezu3WMV5pcPd6RdudWMqMGJBQ9YLOoCQt