@@ -7,6 +7,8 @@ import { createChromeService } from "./services/chrome-service";
77import { createFirefoxService } from "./services/firefox-service" ;
88import { createRestRouter } from "./utils/rest-router" ;
99import { getChromeScreenshot } from "./rest/getChromeScreenshot" ;
10+ import { getFirefoxScreenshot } from "./rest/getFirefoxScreenshot" ;
11+ import { SERVER_ORIGIN } from "./utils/urls" ;
1012
1113const playgroundHtml = playgroundHtmlTemplate . replace (
1214 "{{VERSION}}" ,
@@ -24,10 +26,12 @@ export function createServer(config?: ServerConfig) {
2426 firefox,
2527 } ) ;
2628
27- const restRouter = createRestRouter ( ) . get (
28- "/api/rest/chrome/:id/screenshots/:index" ,
29- getChromeScreenshot ( chrome ) ,
30- ) ;
29+ const restRouter = createRestRouter ( )
30+ . get ( "/api/rest/chrome/:id/screenshots/:index" , getChromeScreenshot ( chrome ) )
31+ . get (
32+ "/api/rest/firefox/:id/screenshots/:index" ,
33+ getFirefoxScreenshot ( firefox ) ,
34+ ) ;
3135
3236 const httpServer = Bun . serve ( {
3337 port,
@@ -39,7 +43,7 @@ export function createServer(config?: ServerConfig) {
3943 return createResponse ( undefined , { status : 204 } ) ;
4044 }
4145
42- const url = new URL ( req . url , process . env . SERVER_ORIGIN ) ;
46+ const url = new URL ( req . url , SERVER_ORIGIN ) ;
4347
4448 // REST
4549
0 commit comments