Examples
Quick Start
import { Fastro } from "https://deno.land/x/fastro/mod.ts";
const server = new Fastro();
server.get("/", (req) => req.send("root"));
await server.listen();
You can see above basic example code here: hello.ts
Check the following codes to find out how to:
- send simple text & json data
- handle url parameters
- set custom http headers & status
- handle http posts & get the payload
- change default port & listen optional callback
- create simple Postgres REST API
Middleware
- create very simple middleware
- create middleware in separate file
- import middleware from external file
- create simple jwt auth
- create global & url middleware
- create simple REST API with JWT