This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

feat: move back to bun exports as its 100ms faster approximately

+7 -9
+7 -9
src/index.ts
··· 1 1 import { SlackApp } from "slack-edge"; 2 2 3 3 import { takes } from "./features/index"; 4 - import frontend from "../public/index.html"; 5 4 6 5 import { t } from "./libs/template"; 7 6 import { blog } from "./libs/Logger"; ··· 55 54 56 55 takes(); 57 56 58 - Bun.serve({ 57 + export default { 59 58 port: process.env.PORT || 3000, 60 59 development: environment === "dev", 61 - routes: { 62 - "/": frontend, 63 - "/user/*": frontend, 64 - "/health": new Response("OK"), 65 - }, 66 60 async fetch(request: Request) { 67 61 const url = new URL(request.url); 68 - const path = `/${url.pathname.split("/")[1]}`; 62 + const path = url.pathname; 69 63 70 64 switch (path) { 65 + case "/": 66 + return new Response(`Hello World from ${name}@${version}`); 67 + case "/health": 68 + return new Response("OK"); 71 69 case "/slack": 72 70 return slackApp.run(request); 73 71 case "/api": ··· 76 74 return new Response("404 Not Found", { status: 404 }); 77 75 } 78 76 }, 79 - }); 77 + }; 80 78 81 79 console.log( 82 80 `🚀 Server Started in ${