Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.ambarks.com/llms.txt

Use this file to discover all available pages before exploring further.

Exemploes e práticas recomendadas

Use estes exemplos como referencia para organizar seu projeto antes de enviar pelo dashboard.

Node.js

Estrutura:
node-app/
  package.json
  server.js
  ambarks.json
package.json:
{
  "scripts": {
    "start": "node server.js"
  },
  "dependencies": {}
}
server.js:
import http from "node:http";

const port = process.env.PORT || 3000;

http.createServer((req, res) => {
  res.writeHead(200, { "content-type": "text/plain" });
  res.end("AmbarksCloud OK");
}).listen(port, "0.0.0.0");
ambarks.json:
{
  "build": {
    "installCommand": "npm install"
  },
  "run": {
    "command": "npm start"
  }
}
Configure a porta interna como 3000.

Python com FastAPI

Estrutura:
python-app/
  requirements.txt
  main.py
  ambarks.json
requirements.txt:
fastapi
uvicorn
main.py:
from fastapi import FastAPI

app = FastAPI()

@app.get("/")
def home():
    return {"ok": True}
ambarks.json:
{
  "build": {
    "installCommand": "pip install --no-cache-dir -r requirements.txt"
  },
  "run": {
    "command": "uvicorn main:app --host 0.0.0.0 --port 8000"
  }
}
Configure a porta interna como 8000.

Site estatico

Estrutura:
site/
  index.html
index.html:
<h1>Publicado no AmbarksCloud</h1>
Configure a porta interna como 80.

Enviar por ZIP

Compacte a pasta do projeto:
zip -r node-app.zip node-app
Depois, envie o ZIP no fluxo Arquivo ZIP do dashboard.