forked from boomerang-io/flow.web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
35 lines (31 loc) · 1.15 KB
/
index.js
File metadata and controls
35 lines (31 loc) · 1.15 KB
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 React from "react";
import { render } from "react-dom";
import { Server, Response } from "miragejs";
import Root from "./Root";
import { startApiServer } from "./apiServer";
import "Config/axiosGlobalConfig";
import "typeface-ibm-plex-sans";
import "Styles/styles.scss";
if (process.env.NODE_ENV === "development" && !process.env.REACT_APP_PORT_FORWARD) {
startApiServer({ environment: "development", timing: 400 });
}
if (window.Cypress) {
new Server({
environment: "test",
routes() {
let methods = ["get", "put", "patch", "post", "delete"];
methods.forEach((method) => {
this[method]("/*", async (schema, request) => {
let [status, headers, body] = await window.handleFromCypress(request);
return new Response(status, headers, body);
});
});
},
});
}
// Setup hot module reloading to improve dev experience
render(<Root />, document.getElementById("app"));
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: http://bit.ly/CRA-PWA
//serviceWorker.unregister();