mirror of
https://github.com/rjNemo/deno_hello
synced 2026-06-06 10:06:40 +00:00
15 lines
371 B
TypeScript
15 lines
371 B
TypeScript
import { Application, Router } from "./deps.ts";
|
|
|
|
type AppOpts = { port: number; router: Router };
|
|
|
|
export const getApplication = ({ port, router }: AppOpts): Application => {
|
|
const app = new Application();
|
|
|
|
app.use(router.routes());
|
|
|
|
app.addEventListener(
|
|
"listen",
|
|
() => console.log(`Server listening on http://localhost:${port}/`),
|
|
);
|
|
return app;
|
|
};
|