polaris icon indicating copy to clipboard operation
polaris copied to clipboard

Running express server (written in typescript) in production

Open tanaypratap opened this issue 7 years ago • 2 comments

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

  1. Suggest a way where this compilation to JS is not needed.
  2. Add a how-to-run-in-production.md in docs folder.
  3. Delete the server folder with JS code.
  4. 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 avatar Oct 05 '18 14:10 tanaypratap

@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.

IamRaviTejaG-zz avatar Oct 05 '18 14:10 IamRaviTejaG-zz

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.

tanaypratap avatar Oct 05 '18 14:10 tanaypratap