Quick Start Guide¶
Get started with USL in 5 minutes!
Install USL¶
Verify:
Create Project¶
Write Your First Spec¶
Create hello.usl:
domain HelloApp {
entity Greeting {
id: GreetingId @primary
message: String
createdAt: Timestamp
}
}
service GreetingService {
action sayHello(name: String) -> Greeting
effects { Write(Greeting) }
implementation {
let greeting = Greeting {
id: generateId(),
message: "Hello, " + name + "!",
createdAt: now()
}
store(greeting)
return greeting
}
}
Compile¶
Generate Code¶
Run It¶
Test It¶
curl -X POST http://localhost:3000/api/sayHello \
-H "Content-Type: application/json" \
-d '{"name": "World"}'
Response: