31 lines
775 B
TypeScript
31 lines
775 B
TypeScript
import { OkResponse } from './utilities/responseHelper';
|
|
import auth from './routes/auth';
|
|
import users from './routes/users';
|
|
import players from './routes/players';
|
|
import games from './routes/games';
|
|
import invites from './routes/invites';
|
|
import collections from './routes/collections';
|
|
|
|
const server = Bun.serve({
|
|
routes: {
|
|
...auth,
|
|
...users,
|
|
...players,
|
|
...games,
|
|
...invites,
|
|
...collections,
|
|
'/test': {
|
|
GET: () => {
|
|
return new OkResponse();
|
|
},
|
|
},
|
|
},
|
|
|
|
// (optional) fallback for unmatched routes:
|
|
fetch(): Response {
|
|
return Response.json({ message: 'Not found' }, { status: 404 });
|
|
},
|
|
});
|
|
|
|
console.log(`Server running at ${server.url}`);
|