Introduction
Before you begin, make sure you have Node.js and npm installed on your system. If you don’t have them yet, you can download them from the official Node.js website.
Files to Exclude Before Upload
node_modules
node_modules
This folder does not need to be uploaded, as it will be created during the installation process in the production environment.
package-lock.json
package-lock.json
This file is not necessary because the production environment will install dependencies based on
.package.json
.Why Exclude These Files?
There are several reasons to exclude and before uploading your project:node_modules
, package-lock.json
Installation Consistency
Not uploading the folder ensures dependencies are installed by the production environment, resulting in a consistent build free from local system discrepancies.
node_modules
Up-to-Date Installations
The production environment will install the latest compatible versions of listed dependencies, providing a clean start for your application.
package.json
Reduced Upload Size
Leaving these files out reduces the upload file size, speeding up the upload process and making deployment more efficient.
Required Files
Two files are required to host your Node.js project on Hostza:mainFile.js/.ts (Example main file)
mainFile.js/.ts (Example main file)
Main application file for Hostza to initialize your project.
package.json (Dependency File)
package.json (Dependency File)
Your application’s dependency file for Hostza to read and install your project’s dependencies.
Hostza natively supports , running your project through
ts-node
, but it is always recommended to compile to since we are a production platform. TypeScript
JavaScript