Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
hmt committed Mar 30, 2022
1 parent 45c9937 commit aeed459
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { opine, Router, secret, HttpError, Color, deferred, Deferred } from "./deps.ts";
import { opine, ErrorRequestHandler, Router, secret, HttpError, Color, deferred, Deferred } from "./deps.ts";
import { BBB } from './bbb.ts';
import { Servers } from './servers.ts'
import type { server } from './deps.ts'
Expand Down Expand Up @@ -73,7 +73,7 @@ router.get("/", (req, res, next) => {
res.send(`<response><returncode>SUCCESS</returncode><version>2.0</version></response>`);
})

const errorHandler = (err, req, res, next) => {
const errorHandler: ErrorRequestHandler = (err, req, res, next) => {
res.setStatus(err.status ?? 500);
res.end();
console.log(`${Color.red(`${res.status}`)} ${req.originalUrl}`)
Expand Down
4 changes: 2 additions & 2 deletions bbb.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHash } from "./deps.ts";
import { Request, ParamsDictionary, createHash } from "./deps.ts";
import type { server } from './deps.ts'

export class BBB {
Expand All @@ -9,7 +9,7 @@ export class BBB {
meeting_id: string
url: string

constructor(req) {
constructor(req: Request<ParamsDictionary, any, any>) {
this.call = req.params.call
this.checksum_incoming = req.query.checksum
this.query = req._parsedUrl?.query || ""
Expand Down
3 changes: 2 additions & 1 deletion deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export { join } from "https://deno.land/std/path/mod.ts";
export { createHash } from "https://deno.land/std/hash/mod.ts";
export * as Color from "https://deno.land/std/fmt/colors.ts";
export { HttpError } from "https://deno.land/x/http_error@0.1.3/mod.ts";
export { opine, Router } from "https://deno.land/x/opine@2.1.5/mod.ts";
export { opine, Router } from "https://deno.land/x/opine@1.9.1/mod.ts";
export type { ErrorRequestHandler, Request, ParamsDictionary } from "https://deno.land/x/opine@1.9.1/mod.ts";
export const secret: string = Deno.env.get("TINYSCALE_SECRET") || ""
export interface server { host: string; secret: string };

0 comments on commit aeed459

Please sign in to comment.