1
1
import { delay , http , HttpResponse } from "msw" ;
2
2
3
3
const openHandsHandlers = [
4
- http . get ( "http://localhost:3000 /api/options/models" , async ( ) => {
4
+ http . get ( "http://localhost:3001 /api/options/models" , async ( ) => {
5
5
await delay ( ) ;
6
6
return HttpResponse . json ( [
7
7
"gpt-3.5-turbo" ,
@@ -10,17 +10,17 @@ const openHandsHandlers = [
10
10
] ) ;
11
11
} ) ,
12
12
13
- http . get ( "http://localhost:3000 /api/options/agents" , async ( ) => {
13
+ http . get ( "http://localhost:3001 /api/options/agents" , async ( ) => {
14
14
await delay ( ) ;
15
15
return HttpResponse . json ( [ "CodeActAgent" , "CoActAgent" ] ) ;
16
16
} ) ,
17
17
18
- http . get ( "http://localhost:3000 /api/options/security-analyzers" , async ( ) => {
18
+ http . get ( "http://localhost:3001 /api/options/security-analyzers" , async ( ) => {
19
19
await delay ( ) ;
20
20
return HttpResponse . json ( [ "mock-invariant" ] ) ;
21
21
} ) ,
22
22
23
- http . get ( "http://localhost:3000 /api/list-files" , async ( { request } ) => {
23
+ http . get ( "http://localhost:3001 /api/list-files" , async ( { request } ) => {
24
24
await delay ( ) ;
25
25
26
26
const token = request . headers
@@ -32,11 +32,11 @@ const openHandsHandlers = [
32
32
return HttpResponse . json ( [ "file1.ts" , "dir1/file2.ts" , "file3.ts" ] ) ;
33
33
} ) ,
34
34
35
- http . post ( "http://localhost:3000 /api/save-file" , ( ) =>
35
+ http . post ( "http://localhost:3001 /api/save-file" , ( ) =>
36
36
HttpResponse . json ( null , { status : 200 } ) ,
37
37
) ,
38
38
39
- http . get ( "http://localhost:3000 /api/select-file" , async ( { request } ) => {
39
+ http . get ( "http://localhost:3001 /api/select-file" , async ( { request } ) => {
40
40
await delay ( ) ;
41
41
42
42
const token = request . headers
@@ -58,7 +58,7 @@ const openHandsHandlers = [
58
58
return HttpResponse . json ( null , { status : 404 } ) ;
59
59
} ) ,
60
60
61
- http . post ( "http://localhost:3000 /api/submit-feedback" , async ( ) => {
61
+ http . post ( "http://localhost:3001 /api/submit-feedback" , async ( ) => {
62
62
await delay ( 1200 ) ;
63
63
64
64
return HttpResponse . json ( {
@@ -87,7 +87,10 @@ export const handlers = [
87
87
{ id : 2 , full_name : "octocat/earth" } ,
88
88
] ) ;
89
89
} ) ,
90
- http . post ( "http://localhost:3000 /api/submit-feedback" , async ( ) =>
90
+ http . post ( "http://localhost:3001 /api/submit-feedback" , async ( ) =>
91
91
HttpResponse . json ( { statusCode : 200 } , { status : 200 } ) ,
92
92
) ,
93
+ http . post ( "https://us.i.posthog.com/e" , async ( ) =>
94
+ HttpResponse . json ( null , { status : 200 } ) ,
95
+ ) ,
93
96
] ;
0 commit comments