-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove deprecated XHR fallback
BREAKING CHANGE: Requires PeerJS >= 1.0
- Loading branch information
1 parent
5d882dd
commit d900145
Showing
8 changed files
with
2 additions
and
100 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,23 @@ | ||
import bodyParser from "body-parser"; | ||
import cors from "cors"; | ||
import express from "express"; | ||
import publicContent from "../../app.json"; | ||
import { IConfig } from "../config"; | ||
import { IMessageHandler } from "../messageHandler"; | ||
import { IRealm } from "../models/realm"; | ||
import { AuthMiddleware } from "./middleware/auth"; | ||
import CallsApi from "./v1/calls"; | ||
import PublicApi from "./v1/public"; | ||
|
||
export const Api = ({ config, realm, messageHandler }: { | ||
export const Api = ({ config, realm }: { | ||
config: IConfig; | ||
realm: IRealm; | ||
messageHandler: IMessageHandler; | ||
}): express.Router => { | ||
const authMiddleware = new AuthMiddleware(config, realm); | ||
|
||
const app = express.Router(); | ||
|
||
const jsonParser = bodyParser.json(); | ||
|
||
app.use(cors()); | ||
|
||
app.get("/", (_, res) => { | ||
res.send(publicContent); | ||
}); | ||
|
||
app.use("/:key", PublicApi({ config, realm })); | ||
app.use("/:key/:id/:token", authMiddleware.handle, jsonParser, CallsApi({ realm, messageHandler })); | ||
|
||
return app; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters