@@ -10,7 +10,6 @@ import {
1010 type GitHubApiClient ,
1111 RealGitHubApiClient ,
1212} from "./lib/github-api-client.ts" ;
13- import { App , staticFiles } from "fresh" ;
1413import { ConfigProvider } from "./config.ts" ;
1514import { LoggerFactory } from "./logger.ts" ;
1615import { InsightsPageController } from "./routes/insights.tsx" ;
@@ -26,6 +25,8 @@ export interface AppState {
2625 store : AppStore ;
2726}
2827
28+ export type AppStore = ReturnType < typeof createRequestStore > ;
29+
2930const configProvider = new ConfigProvider ( ) ;
3031
3132// services that live for the duration of the application
@@ -57,9 +58,7 @@ const appStore = defineStore()
5758 } )
5859 . finalize ( ) ;
5960
60- export type AppStore = ReturnType < typeof createRequestStore > ;
61-
62- function createRequestStore ( ) {
61+ export function createRequestStore ( ) {
6362 // services that live for the duration of a request
6463 return appStore . createChild ( )
6564 . add ( "logger" , ( store ) => {
@@ -86,14 +85,3 @@ function createRequestStore() {
8685 } )
8786 . finalize ( ) ;
8887}
89-
90- export const app = new App < AppState > ( ) ;
91-
92- app . use ( staticFiles ( ) ) ;
93-
94- app . use ( async ( ctx ) => {
95- using scopedStore = createRequestStore ( ) ;
96- ctx . state . store = scopedStore ;
97- return await ctx . next ( ) ;
98- } ) ;
99- app . fsRoutes ( ) ;
0 commit comments