๐ NodeJS backend with APIs to execute long running tasks and stop them in between
- This repository has Dockerfile, so you can create docker image by running docker build command.
- The app.js contains PORT variable which is set to 8080, you can modify if needed.
- Once app is started you can send GET request to /longTask endpoint to start long running task.
- You will see the PID for long running task, if you want to stop that task you can pass that PID to /killprocess/:pid endpoint.
This app provides two APIs:
- /longTask (This endpont will start a long task as child process)
- /killprocess/:pid (Here you can specify the id of process which you want to stop)
You can use this to execute and stop long running tasks
- NodeJS Docs To understand how the process work in NodeJS.
- NodeJS Docker Docs To understand how to create docker image for the app.