Skip to content

Quick Start

GitHub Actions edited this page Jan 25, 2026 · 2 revisions

🚀 VelinScript Quick Start

5 Minuten bis zu deinem ersten API-Endpoint!


Schritt 1: Projekt erstellen

# Beide Befehle funktionieren:
velin new my-api
# oder
velin init my-api

cd my-api

Schritt 2: Code schreiben

Öffne main.velin und schreibe:

@GET("/api/hello")
fn hello(): string {
    return "Hello, VelinScript! 🚀";
}

Schritt 3: Kompilieren

velin compile -i main.velin -o main.rs

Schritt 4: Prüfen

velin check -i main.velin

Schritt 5: Ausführen

# Rust-Code kompilieren
cd ..
cargo build --release --manifest-path my-api/Cargo.toml

# Ausführen
cargo run --release --manifest-path my-api/Cargo.toml

🎉 Fertig!

Deine API läuft jetzt auf http://localhost:8080/api/hello


🔑 Mit LLM-Features?

  1. API-Key setzen:

    # Windows
    $env:OPENAI_API_KEY = "sk-..."
    
    # Linux/Mac
    export OPENAI_API_KEY="sk-..."
  2. Code erweitern:

    @POST("/api/chat")
    fn chat(message: string): string {
        let llm = LLMClient.new("openai", config.get_env("OPENAI_API_KEY", ""));
        return await llm.generate(message);
    }
    

Siehe API-Keys Setup für Details.


📚 Nächste Schritte


🆘 Hilfe


Version: 3.1.0


Zurück zur Übersicht

Clone this wiki locally