polaris
polaris copied to clipboard
Running express server (written in typescript) in production
Requirement
Currently the typescript express server is getting compiled to JS and then you can run it using node or pm2 on the server. Typically in a production environment you would use some process runner which runs only JS code.
Tasks
- Suggest a way where this compilation to JS is not needed.
- Add a how-to-run-in-production.md in docs folder.
- Delete the server folder with JS code.
- Add npm script in package.json to run it in dev and prod mode.
Please Note
This issue is being tagged as hacktoberfest and thus seeing a lot of traffic. If you're going to work on it and raise a PR, please comment. First preference to merge the project will be given to the first comment. However, the person has 24 hours of time to raise the PR. After that, the issue will be open for contribution again.
@tanaypratap Is it more like, shift the whole server to Express (written in NodeJS), so that it doesn't need to be compiled to JS again?! Correct me if I'm wrong.
The whole server is in express currently. The code is supposed to be written in Typescript and then it is compiled into JS using tsc i.e. typescript compiler. What is needed is that something like ts-node which can run it directly on server in its typescript form and eliminate the need of compilation.