1
0
Fork 0
forked from OpenNeo/impress
impress/app/javascript/wardrobe-2020/impress-2020-config.js
Emi Matchu 6763e9454e Optionally use local instance of impress-2020 during development
To activate this, I created a `.env.development` file in my project
root, with the following content:

```env
IMPRESS_2020_ORIGIN=http://localhost:4000
```

Then, I started impress-2020 with `yarn dev --port=4000`.

Now, the app loads from there, hooray!! It even fixes that obnoxious
pet state ID bug that happens when you run against the production db lol
2024-01-28 07:00:29 -08:00

10 lines
325 B
JavaScript

const IMPRESS_2020_ORIGIN = readImpress2020Origin();
export function buildImpress2020Url(path) {
return new URL(path, IMPRESS_2020_ORIGIN).toString();
}
function readImpress2020Origin() {
const node = document.querySelector("meta[name=impress-2020-origin]");
return node?.content || "https://impress-2020.openneo.net"
}