π Introduction
- Ensure Node.js and npm are installed on your system. If not, download them from the official Node.js website.
- Create an account on DS Cloud via the login page using your email, Discord, or both.
- Make sure you have an active paid plan. View and purchase plans here.
βοΈ Creating the dscloud config file
Learn about: how to make the configuration file for DS Cloud.
The
dscloud.pt file configures your application, defining its name, description, version, main file, and more.βΆοΈ Start Application
- Javascript
- Typescript
- If the
STARTfield is not defined in the configuration file, DS Cloud runsnodewith optimization options and specific parameters. If theSTARTfield is defined, its value will be executed directly. Learn more about configuration file parameters here.
- If
node_modulesdoes not exist, DS Cloud runsnpm install --no-package-lock --no-audit --no-fundto install dependencies and clean the.npmfolder.
π₯οΈ Preparing Your Node.js Project
π Essential Configuration Files
To deploy your Node.js project on DS Cloud, include your configuration file (dscloud.pt/.config) and essential application files in a zip file.
ποΈ Files to Exclude Before Uploading
node_modules: DS Cloud will create this folder during installation in the production environment.package-lock.json: Dependencies will be installed based onpackage.jsonin the production environment.
π€ Why Exclude These Files?
- Installation Consistency: Excluding
node_modulesensures dependencies are installed by the production environment, preventing local discrepancies. - Updated Installations: Dependencies are installed with the latest compatible versions listed in
package.json. - Reduced Upload Size: Smaller upload files improve efficiency and deployment speed.
π Required Files
Three files are essential for hosting your Node project:- dscloud.pt/.config
- Main file (
mainFile.jsormainFile.ts) - package.json (dependency file)
DS Cloud supports
TypeScript natively, running projects through ts-node, but compiling to JavaScript is recommended for production.π‘ Troubleshooting
The main file is invalid or corrupted
The main file is invalid or corrupted
Ensure the βmainβ file specified in the configuration exists, is correctly named, and has the correct path. For files in subfolders, use
folder/file.js.Bad Memory
Bad Memory
Minimum RAM requirements:
- Bots: 256MB
- Websites/APIs: 512MB Depending on application size and complexity, allocate more RAM to avoid the LACK_OF_RAM error.
π€ Uploading Project to DS Cloud
After preparing your project files, upload them to DS Cloud to host your application.- Discord Upload
- Go to the DS Cloud Discord server and use the
/upcommand in the#commandschannel. - A new private channel will be created for you.
- Upload your
.zipfile in the created channel to deploy your application.
