Refmt
This commit is contained in:
@@ -3,14 +3,20 @@
|
|||||||
import { sleep } from "https://deno.land/x/sleep/mod.ts";
|
import { sleep } from "https://deno.land/x/sleep/mod.ts";
|
||||||
|
|
||||||
import { HttpCode, httpCodes } from "./http-codes.ts";
|
import { HttpCode, httpCodes } from "./http-codes.ts";
|
||||||
import { ContentType, contentTypes } from "./content-types";
|
import { ContentType, contentTypes } from "./content-types.ts";
|
||||||
import { services } from "./services";
|
import { services } from "./services.ts";
|
||||||
import {DenoRequest, Handler, Response, Method, UserRequest, Request, Route, ProcessedRoute } from './types.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;
|
const code = httpCodes.success.OK;
|
||||||
return {
|
return {
|
||||||
code,
|
code,
|
||||||
@@ -19,8 +25,6 @@ const phandler: Handler = async (req: Request) => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// FIXME: Obviously put this somewhere else
|
// FIXME: Obviously put this somewhere else
|
||||||
const okText = (out: string) => {
|
const okText = (out: string) => {
|
||||||
const code = httpCodes.success.OK;
|
const code = httpCodes.success.OK;
|
||||||
@@ -39,7 +43,8 @@ const routes: Route[] = [
|
|||||||
handler: async (_req) => {
|
handler: async (_req) => {
|
||||||
console.log("starting slow request");
|
console.log("starting slow request");
|
||||||
await sleep(10);
|
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