Documentation Index
Fetch the complete documentation index at: https://docs.vertracloud.app/llms.txt
Use this file to discover all available pages before exploring further.
Requirements
- Bun 1.1.0+ installed locally
- Account on Vertra Cloud
- Configured
package.json
Project Structure
my-server-bun/
├── src/
│ └── index.ts
├── package.json
├── bunfig.toml
└── vertracloud.config
Configuration
package.json
{
"name": "my-server-bun",
"version": "1.0.0",
"type": "module",
"scripts": {
"start": "bun run src/index.ts"
},
"dependencies": {
"elysia": "^0.7.0"
},
"devDependencies": {
"bun-types": "latest"
}
}
bunfig.toml
vertracloud.config
MAIN=package.json
START=bun run src/index.ts
VERSION=recommended
Example: Simple Server with Bun.serve()
src/index.ts
const port = parseInt(process.env.PORT || "80");
const hostname = "0.0.0.0";
const server = Bun.serve({
port: port,
hostname: hostname,
fetch(request: Request) {
const url = new URL(request.url);
// Root route
if (url.pathname === "/" && request.method === "GET") {
return Response.json({
message: "API Bun on Vertra Cloud",
version: "1.0.0",
runtime: "Bun"
});
}
// Health check
if (url.pathname === "/health" && request.method === "GET") {
return Response.json({
status: "healthy",
service: "bun-api",
uptime: Math.floor(process.uptime())
});
}
// API items
if (url.pathname === "/api/items" && request.method === "GET") {
const items = [
{ id: 1, name: "Item 1", description: "Description 1" },
{ id: 2, name: "Item 2", description: "Description 2" }
];
return Response.json(items);
}
// 404
return Response.json({ error: "Not found" }, { status: 404 });
}
});
console.log(`Server running at http://${hostname}:${port}/`);
Deploy
Via Dashboard
Via GitHub
Via VSCode
- Execute
bun install locally
- Exclude
node_modules folder from the project
- Compress into a ZIP file
- Access Dashboard → New Project → Application
- Select Bun language and upload
- Configure memory (256MB for simple servers)
- Click “Create Application”
- Push the project to GitHub (with
package.json at root)
- Access Dashboard → New Project → Application
- Select “GitHub” as source
- Choose the repository and configure resources
- Click “Create Application”
- Open the project in VSCode with Vertra Cloud extension installed
- Press
Ctrl+Shift+P and type “Vertra: Deploy”
- Select or create the target application
- Wait for automatic upload and deployment
Available Versions
| Version | Status | Description |
|---|
| 1.2.2 | Recommended | Bun 1.2.2 LTS (recommended for production) |
| 1.2.2 | Latest | Bun 1.2.2 (latest version) |
| 1.1.0 | Stable | Bun 1.1.0 with extended support |
Notes
- Performance: Bun is significantly faster than Node.js
- Native TypeScript: Bun runs TypeScript directly without compilation
- Compatibility: Bun is compatible with Node.js/npm, but has some differences
- Environment variables: Access via
process.env.KEY
- Logs: Use
console.log() for logs that appear in dashboard
- Modules: Use
bun add to add dependencies
- Listen on
0.0.0.0 on port $PORT