Fluxon Docs

Examples

A complete small program that ties the whole language together.

A complete small program (all together)

use http db ai json

tbl notes
  id   serial pk
  text str
  ts   now

http.on :post "/notes" \req ->
  note = db.ins "notes" {text:req.body.text}
  rep 201 note

http.on :get "/notes" \req ->
  rep 200 (db.q "select * from notes order by ts desc")

log "server on :8080"
http.serve 8080

Here is the whole language. use it, declare a table with tbl, a route with http.on, storage with db — no installs, no connection code, no boilerplate.

On this page