FaasJS's server module.
# If you are using bun, tsx is not required.
npm install @faasjs/server tsx
- Create a
server.ts
file:
// server.ts
import { Server } from '@faasjs/server'
const server = new Server({
// options
})
server.start()
- Run the server:
tsx server.ts // or `bun server.ts` if you are not using bun
Static routing:
-
/
->index.func.ts
orindex.func.tsx
-
/path
->path.func.ts
orpath.func.tsx
orpath/index.func.ts
orpath/index.func.tsx
Dynamic routing:
-
/*
->default.func.ts
ordefault.func.tsx
-
/path/*
->path/default.func.ts
orpath/default.func.tsx