This repository has no description
0

Configure Feed

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

chore: move to bun serve

+9 -14
+9 -14
src/index.ts
··· 1 1 import { SlackApp } from "slack-edge"; 2 2 3 - import * as features from "./features/index"; 3 + import { takes } from "./features/index"; 4 4 5 5 import { t } from "./libs/template"; 6 6 import { blog } from "./libs/Logger"; ··· 52 52 }); 53 53 const slackClient = slackApp.client; 54 54 55 - console.log(`⚒️ Loading ${Object.entries(features).length} features...`); 56 - for (const [feature, handler] of Object.entries(features)) { 57 - console.log(`📦 ${feature} loaded`); 58 - if (typeof handler === "function") { 59 - handler(); 60 - } 61 - } 55 + takes(); 62 56 63 - export default { 57 + Bun.serve({ 64 58 port: process.env.PORT || 3000, 59 + development: environment === "development", 60 + routes: { 61 + "/": new Response(`Hello World from ${name}@${version}`), 62 + "/health": new Response("OK"), 63 + }, 65 64 async fetch(request: Request) { 66 65 const url = new URL(request.url); 67 66 const path = `/${url.pathname.split("/")[1]}`; 68 67 69 68 switch (path) { 70 - case "/": 71 - return new Response(`Hello World from ${name}@${version}`); 72 - case "/health": 73 - return new Response("OK"); 74 69 case "/slack": 75 70 return slackApp.run(request); 76 71 case "/api": ··· 79 74 return new Response("404 Not Found", { status: 404 }); 80 75 } 81 76 }, 82 - }; 77 + }); 83 78 84 79 console.log( 85 80 `🚀 Server Started in ${