How to create dist for on node js application

3.2k Views Asked by At

I have created an application in node js with express framework. And need to deploy it on production server.

But don't want to deploy whole project on the server because security purpose. I want to create minified dist directory and deploy it on the production.

Is their any approach available to achieve this.

2

There are 2 best solutions below

1
On

You have to upload express server and related route files on server. As express run directly by node.js. you don't have to minify it.

By default express block access to other files which is not used for server.

You can allow access to other files like index.html based on link here

5
On

I guess what you're looking for a packager. You can try Parcel JS to bundle your project.