@@ -7,6 +7,8 @@ import { createChromeService } from "./services/chrome-service";
7
7
import { createFirefoxService } from "./services/firefox-service" ;
8
8
import { createRestRouter } from "./utils/rest-router" ;
9
9
import { getChromeScreenshot } from "./rest/getChromeScreenshot" ;
10
+ import { getFirefoxScreenshot } from "./rest/getFirefoxScreenshot" ;
11
+ import { SERVER_ORIGIN } from "./utils/urls" ;
10
12
11
13
const playgroundHtml = playgroundHtmlTemplate . replace (
12
14
"{{VERSION}}" ,
@@ -24,10 +26,12 @@ export function createServer(config?: ServerConfig) {
24
26
firefox,
25
27
} ) ;
26
28
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
+ ) ;
31
35
32
36
const httpServer = Bun . serve ( {
33
37
port,
@@ -39,7 +43,7 @@ export function createServer(config?: ServerConfig) {
39
43
return createResponse ( undefined , { status : 204 } ) ;
40
44
}
41
45
42
- const url = new URL ( req . url , process . env . SERVER_ORIGIN ) ;
46
+ const url = new URL ( req . url , SERVER_ORIGIN ) ;
43
47
44
48
// REST
45
49
0 commit comments