-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathhandlers.ts
More file actions
35 lines (31 loc) · 932 Bytes
/
handlers.ts
File metadata and controls
35 lines (31 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { rest } from "msw";
import {readFileSync} from 'fs';
import path from "path";
const registry = readFileSync(path.resolve(__dirname, "../../public/registry.db"));
const projectsListWithDefaultProject = rest.get(
"/projects-list.json",
(req, res, ctx) => {
return res(
ctx.status(200),
ctx.json({
default: "credit_score_project",
projects: [
{
name: "Credit Score Project",
description:
"Project for credit scoring team and associated models.",
id: "credit_score_project",
registryPath: "/registry.pb",
},
],
})
);
}
);
const creditHistoryRegistry = rest.get("/registry.pb", (req, res, ctx) => {
return res(
ctx.status(200),
ctx.set('Content-Type', 'application/octet-stream'),
ctx.body(registry));
});
export { projectsListWithDefaultProject, creditHistoryRegistry };