Go-native TypeScript/JavaScript runtime with HTTP, DB, FS, fetch, crypto and JWT APIs.
1.6K
Golt is a lightweight TypeScript/JavaScript backend runtime written in Go.
It bundles a TypeScript entry file with esbuild and executes it inside a Go-hosted JavaScript engine, exposing a small and explicit backend API surface for HTTP, SQL databases, filesystem access, crypto, JWT, environment variables, logging, and outbound HTTP requests.
docker pull aztekode/golt:latest
Available tags:
aztekode/golt:latest
aztekode/golt:1.0.2
Run a Golt project from your current directory:
docker run --rm \
-p 3000:3000 \
-v "$PWD":/workspace \
-w /workspace \
aztekode/golt:latest \
run app.ts
PowerShell:
docker run --rm `
-p 3000:3000 `
-v "${PWD}:/workspace" `
-w /workspace `
aztekode/golt:latest `
run app.ts
Then open:
http://localhost:3000
app.tsconst app = Golt.App();
app.use(Golt.logger({ format: "dev" }));
app.get("/", (ctx) => {
ctx.Json({
ok: true,
message: "Hello from Golt inside Docker",
});
});
app.serve(3000);
Create a Dockerfile in your Golt project:
FROM aztekode/golt:latest
WORKDIR /app
COPY . .
EXPOSE 3000
CMD ["run", "app.ts"]
Build and run your app:
docker build -t my-golt-app .
docker run --rm -p 3000:3000 my-golt-app
services:
app:
image: aztekode/golt:latest
working_dir: /workspace
command: ["run", "app.ts"]
ports:
- "3000:3000"
volumes:
- .:/workspace
Run it with:
docker compose up
Golt currently provides:
console.logGolt.envGolt.AppGolt.loggerGolt.dbGolt.fsGolt.cryptoGolt.jwtfetch()Use db.exec() for statements that do not return rows, and db.query() for statements that return rows.
const db = Golt.db.connect("sqlite", "./app.db");
await db.exec(`
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL
)
`);
await db.exec("INSERT INTO users(name) VALUES (?)", "Ada");
const users = await db.query("SELECT id, name FROM users");
console.log(users);
This project currently does not include an open source license file. Until a license is added, all rights are reserved by default.
Content type
Image
Digest
sha256:92e0bedbf…
Size
14 MB
Last updated
5 months ago
docker pull aztekode/golt