Skip to content

Commit cf4bb82

Browse files
committed
chore: wip
1 parent 4487dc5 commit cf4bb82

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

storage/framework/core/router/src/router.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { RedirectCode, Route, RouteGroupOptions, StatusCode } from '@stacksjs/types'
2-
import { path as p, projectPath } from '@stacksjs/path'
2+
import { path as p, routesPath } from '@stacksjs/path'
33
import { pascalCase } from '@stacksjs/strings'
44

55
type Prefix = string
@@ -57,6 +57,7 @@ export class Router implements RouterInterface {
5757
public async get(path: Route['url'], callback: Route['callback']): Promise<this> {
5858
this.path = this.normalizePath(path)
5959
callback = await this.resolveCallback(callback)
60+
// eslint-disable-next-line no-console
6061
console.log('this.path', this.path, callback)
6162

6263
return this.addRoute('GET', this.prepareUri(this.path), callback, 200)
@@ -197,15 +198,7 @@ export class Router implements RouterInterface {
197198
}
198199

199200
public async getRoutes(): Promise<Route[]> {
200-
// const routeFileData = (await readTextFile(projectPath('routes/web.ts'))).data
201-
202-
await import(projectPath('routes/api.ts'))
203-
204-
// run routes/web.ts
205-
// const webRoutesPath = projectPath('routes/web.ts')
206-
// await runCommand(`bun ${webRoutesPath}`)
207-
208-
// set this.routes to a mapped array of routes that matches the pattern
201+
await import(routesPath('api.ts'))
209202

210203
return this.routes
211204
}

0 commit comments

Comments
 (0)