Commit edfd2336 authored by Julien Bouquillon's avatar Julien Bouquillon 🐫
Browse files

fix(api): use CORS

parent 578c9e3b
......@@ -14,6 +14,7 @@
"dependencies": {
"@babel/runtime": "^7.12.13",
"@elastic/elasticsearch": "^7.12.0",
"@koa/cors": "^3.1.0",
"koa": "^2.13.1",
"koa-router": "^10.0.0"
},
......
import Koa from "koa";
import cors from "@koa/cors";
import { router } from "./routes";
export const app = new Koa();
app.use(cors());
const port = process.env.API_PORT || 3000;
app.use(router.routes());
app.listen(port);
console.log(`API started on port ${port}`);
console.log('ES host:', process.env.ELASTICSEARCH_URL)
console.log("ES host:", process.env.ELASTICSEARCH_URL);
......@@ -501,6 +501,13 @@
"@types/yargs" "^15.0.0"
chalk "^4.0.0"
"@koa/cors@^3.1.0":
version "3.1.0"
resolved "https://registry.yarnpkg.com/@koa/cors/-/cors-3.1.0.tgz#618bb073438cfdbd3ebd0e648a76e33b84f3a3b2"
integrity sha512-7ulRC1da/rBa6kj6P4g2aJfnET3z8Uf3SWu60cjbtxTA5g8lxRdX/Bd2P92EagGwwAhANeNw8T8if99rJliR6Q==
dependencies:
vary "^1.1.2"
"@sinonjs/commons@^1.7.0":
version "1.8.2"
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.2.tgz#858f5c4b48d80778fde4b9d541f27edc0d56488b"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment