Tin

Examples · learn/30-server · 303 of 339

hello.serve

examples/learn/30-server/hello.serve.tintin run examples/learn/30-server/hello.serve.tin
/// Says hello over HTTP.
server Api grants [net.listen(8080)] {
  get "/" (req) => "hello from Tin"
  get "/hello/:name" (req) => "hi {req.params.getOr("name", "")}"
  post "/echo" (req) => "you sent {req.body.len} bytes"
}