Getting Started
Prerequisites you need to have:
- Node
- NPM
- Optional: A MongoDB database, either locally or in the cloud
Use the starter with npx
Create your own Temba server instantly:
npx temba-cli create my-rest-api
This command will:
- Create a new folder called
my-rest-api - Install Temba as a dependency
- Generate a
server.jsfile - Automatically start your brand-new Temba API
You'll see:
✅ Server listening on port 8362
Now you can send any HTTP request to any resource on localhost:8362 — and it just works.
Or head over to the interactive OpenAPI specification of your API in your browser at /openapi.
Adding to an existing app
Alternatively, add Temba to your app manually:
-
npm i temba -
Example code to create a Temba server:
import { create } from "temba"
const server = await create()
server.start()
- In your console you'll see:
✅ Server listening on port 8362
Configuration
To opt-out or customize Temba's workings, pass a config object to the create function. Check out the individual feature pages in the sidebar, or the config settings overview.