How to Create Service for Specified File Directory via nodejs

  node.js, question

Hello, everyone, I am a new Node, now I want to ask a question, I know nodejs has http module, which can be used as a service, and other modules can be referenced.
Now I’m thinking about whether node can implement the same configuration file as nginx and apache, which can configure port number and project directory (the front-end project can be located anywhere in the machine, just need to configure the directory here, you can pass 127. 0.0.1: Port number access), when I think of a service every day, I just need to run this js file. The main consideration of this issue isLocalTo use, so do not consider performance issues. Can this be achieved? How?
I don’t need a very detailed answer. I hope I can get some advice.

Summarize the requirements: How to create a service for the specified file directory through nodejs?

Ps: nodejs is definitely not wanted to replace NG Nix ngnix,apache. After all, there are specialities in the technical field, only possibilities are discussed.

It has been solved, but it is actually quite simple. I think it is complicated. …