GithubHelp home page GithubHelp logo

100ms-sample-backend-nodejs's Introduction

Documentation Discord MIT License Register

Sample backend app for Node.js

This is a sample backend app built on Node.js with Express.js middleware and the 100ms REST APIs. Exposed endpoints

  • Create room
  • Get auth token to join the room
  • Get usage analytics

Get 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!

Deploy to Render

Installation

  1. Clone the repo

    git clone https://github.com/100mslive/100ms-sample-backend-nodejs.git
    
  2. Install the dependencies

    npm i
    
  3. Rename the .env.example to .env and add your credentials

    APP_ACCESS_KEY=<YOUR_APP_ACCESS_KEY>
    APP_SECRET=<YOUR_APP_SECRET>
    
  4. Run the app

    Running in dev mode (hot reload on file changes):

    npm run start:dev
    

    Running in production:

    npm run start
    

    Run with Docker Compose

    docker compose up --build
    

Usage

This sample exposes the following endpoints

Endpoint Method Parameters Description
/create-room POST JSON body
{
  "name": "new-room-1",
  "description": "Sample description",
  "template_id": "6318xxxxxxxxxxxxxxxc60"
}
Create a new room with room params (docs)
/auth-token POST JSON body
{
  "room_id": "632ecxxxxxxxxxxxxxxxx764",
  "role": "host",
  "user_id":"test_user"
}
Generate an auth token for a peer to join a room (docs)
/session-analytics-by-room GET Query params
?room_id=633dxxxxxxxxxxxxxxx7d1d2
Usage analytics for a specific session (docs)
/session-list-by-room GET Query params
?room_id=633dxxxxxxxxxxxxxxx7d1d2
Get list of all sessions associated with a room (docs)

Docs

Refer to the 100ms server-side docs to get started on your custom backend.

100ms-sample-backend-nodejs's People

Contributors

arjunattam avatar coder-with-a-bushido avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.