Javascript
Complete guide to host JavaScript applications on Discloud.
📁 Preparing the Files
Before uploading your project, you must exclude unnecessary files to optimize the deployment.
❌ Files to Exclude
Ensure the following files and directories are not included in your .zip
:
- package-lock.json
- node_modules/
- .cache/
- .git/
📌 Use a .discloudignore
file to automatically exclude these files.
🔗 Need help setting up your package.json
or find main file?
🌐 Hosting Websites & APIs with Express
Before deploying your website or API on Discloud, ensure that you meet the following requirements:
Platinum plan or higher is required to host websites or APIs.
A subdomain must be created before deployment.
Port 8080
is mandatory – Applications must listen on this port.
⚙️ Configuring Express
const express = require("express");
const app = express();
app.get("/", (req, res) => {
res.send("Hello, Discloud!");
});
const PORT = process.env.PORT || 8080;
app.listen(PORT, () => console.log(`Server running on port ${PORT}`));
✍️ Deploying Your Application
Once your project is configured and compressed, you can choose one of the following deployment methods on Discloud:
Last updated