100ms Sample Backend - NodeJs
About
This is a sample backend app built on Node.js with Express.js middleware using 100ms REST APIs to showcase some basic functionalities.
Getting Started
Deploy directly to Render using this button. But don't forget to add the environment variables specified in .env.example
to Render or the build will fail!
Installation
- Clone the repo
git clone https://github.com/coder-with-a-bushido/100ms-sample-backend-nodejs.git
- Install the dependencies
npm i
- Rename the
.env.example
to.env
and add your credentials
APP_ACCESS_KEY=<YOUR_APP_ACCESS_KEY>
APP_SECRET=<YOUR_APP_SECRET>
- Run the app
Running in dev mode (hot reload on file changes):
npm run start:dev
Running in production:
npm run start
Or
docker compose up --build
Usage
This sample backend app exposes the following endpoints:
Endpoint | Method | Request | Description |
---|---|---|---|
/app-token |
POST | JSON Body Params:{ |
Generate an auth token for a peer to join a room. Please refer to https://www.100ms.live/docs/server-side/v2/introduction/authentication-and-tokens |
/create-room |
POST | JSON Body Params:{Or { |
Create a new room, either randomly or with the requested configuration. Please refer to https://www.100ms.live/docs/server-side/v2/Rooms/create-via-api |
/session-analytics |
GET | Query Params:{ |
Get Session Analytics for a specific session (like attendance). Please refer to https://www.100ms.live/docs/server-side/v2/Sessions/example-build-attendance |
100ms SDK Documentation
Refer the 100ms SDK Server-Side guide to get started on building your custom backend with 100ms APIs.