TypeScript
Complete guide to host TypeScript 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 finding the main file?
⚙️ Project Setup for TypeScript
You will typically compile TypeScript to JavaScript with tsc and run the compiled files.
package.json (scripts)
tsconfig.json (minimal)
🌐 Hosting Websites & APIs with Express (TypeScript)
Before deploying your website or API on Discloud, ensure 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.
Express (TS) example
✍️ Deploying Your Application
Once your project is configured and compressed, you can choose one of the following deployment methods on Discloud:
🔎 Quick recap of TypeScript specifics on Discloud
dist/is reserved for Discloud builds on bothTYPE=botandTYPE=site.If you pre-build locally, output to
build/and pointMAINtobuild/....For TypeScript, always provide
BUILDandSTARTindiscloud.configwhen shipping sources;MAINshould point to the runtime JS entry (usuallydist/index.js).For websites/APIs, your server must listen on port
8080.
Last updated