mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 22:56:11 +03:00
b66ee58ee3
swc_bundler: - Reduce binary size by reducing usage of visitor / folders. - Handle `export *` and `export { default }` from same source. (denoland/deno#8530, denoland/deno#8679) - Fix ordering of statements. (denoland/deno#8545) - Sort statements in wrapped modules. (https://github.com/denoland/deno/issues/8211#issuecomment-741070299) - Exclude default export while handling `export *`. - Exclude `export { default }` and `export { foo as default }` while handling `export *`. - Make statements from same module to be injected together. (denoland/deno#8620) swc_ecma_transforms: - fixer: Handle assignments in the callee of `new` correctly. - fixer: Handle seqence expression in the callee of `new` correctly.
18 lines
403 B
TypeScript
18 lines
403 B
TypeScript
import { Application, Router } from "./deps.ts";
|
|
|
|
const app = new Application();
|
|
const router = new Router();
|
|
|
|
router.get("/", (ctx) => {
|
|
ctx.response.body = "Index Page";
|
|
});
|
|
|
|
router.get("/users", (ctx) => {
|
|
ctx.response.body = "Users Page";
|
|
});
|
|
|
|
app.use(router.routes());
|
|
app.use(router.allowedMethods());
|
|
|
|
console.log(`Now listening on http://0.0.0.0:3000`);
|
|
await app.listen("0.0.0.0:3000"); |