Skip to content

IIvexII/Simple-Bun-Web-Server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bun Server

Install

  • Install Bun and thats it.

Run

bun run ./src/index.ts

Example

import { server ,ConfigRoutes } from "./WebServer";

const app = new ConfigRoutes();

app.get('/', () => {
    return 'Hello This is home page';
})

app.get('/users', () => {
    return 'All users will show here.';
})

app.get('/foo', () => {
    return 'Foo';
})
// Pass port and the instance of ConfigureRoutes
server(1234, app);