Refmt
This commit is contained in:
@@ -3,14 +3,20 @@
|
||||
import { sleep } from "https://deno.land/x/sleep/mod.ts";
|
||||
|
||||
import { HttpCode, httpCodes } from "./http-codes.ts";
|
||||
import { ContentType, contentTypes } from "./content-types";
|
||||
import { services } from "./services";
|
||||
import {DenoRequest, Handler, Response, Method, UserRequest, Request, Route, ProcessedRoute } from './types.ts'
|
||||
import { ContentType, contentTypes } from "./content-types.ts";
|
||||
import { services } from "./services.ts";
|
||||
import {
|
||||
DenoRequest,
|
||||
Handler,
|
||||
Method,
|
||||
ProcessedRoute,
|
||||
Request,
|
||||
Response,
|
||||
Route,
|
||||
UserRequest,
|
||||
} from "./types.ts";
|
||||
|
||||
|
||||
|
||||
|
||||
const phandler: Handler = async (req: Request) => {
|
||||
const phandler: Handler = async (_req: Request) => {
|
||||
const code = httpCodes.success.OK;
|
||||
return {
|
||||
code,
|
||||
@@ -19,8 +25,6 @@ const phandler: Handler = async (req: Request) => {
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
// FIXME: Obviously put this somewhere else
|
||||
const okText = (out: string) => {
|
||||
const code = httpCodes.success.OK;
|
||||
@@ -37,9 +41,10 @@ const routes: Route[] = [
|
||||
path: "/slow",
|
||||
methods: ["get"],
|
||||
handler: async (_req) => {
|
||||
console.log("starting slow request") ;
|
||||
console.log("starting slow request");
|
||||
await sleep(10);
|
||||
console.log("finishing slow request"); return okText("that was slow");
|
||||
console.log("finishing slow request");
|
||||
return okText("that was slow");
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -91,11 +96,4 @@ const routes: Route[] = [
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export {routes}
|
||||
export { routes };
|
||||
|
||||
Reference in New Issue
Block a user