@buntal/http 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.ts CHANGED
@@ -41,7 +41,6 @@ export class Http {
41
41
  constructor(private config: Config) {}
42
42
 
43
43
  start(cb?: (server: Bun.Server) => void) {
44
- const res = new Res()
45
44
  const middlewares = this.middlewares
46
45
 
47
46
  const server = Bun.serve({
@@ -52,6 +51,7 @@ export class Http {
52
51
  fetch: async (raw: Request, server): Promise<Response | any> => {
53
52
  if (this.config.websocket && server.upgrade(raw)) return
54
53
 
54
+ const res = new Res()
55
55
  if (raw.method === 'OPTIONS') {
56
56
  return res.send('departed')
57
57
  }
@@ -92,6 +92,7 @@ export class Http {
92
92
  if (this.errorHandler) {
93
93
  return await this.errorHandler(error)
94
94
  }
95
+ const res = new Res()
95
96
  return res.status(500).json({
96
97
  error: error.message,
97
98
  details: error.stack
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buntal/http",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "devDependencies": {
package/router/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export const buildRouter = (dir: string) =>
2
2
  new Bun.FileSystemRouter({
3
3
  style: 'nextjs',
4
- dir,
4
+ dir
5
5
  })