Skip to content

Commit

Permalink
add cors access
Browse files Browse the repository at this point in the history
  • Loading branch information
kiriltaran committed Feb 11, 2020
1 parent 851e0ba commit 4fa4191
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 11 deletions.
36 changes: 25 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"author": "[email protected]",
"license": "MIT",
"dependencies": {
"@types/cors": "^2.8.6",
"axios": "^0.19.2",
"cors": "^2.8.5",
"date-fns": "^2.9.0",
"express": "^4.17.1",
"http-errors": "^1.7.3",
Expand Down
2 changes: 2 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import express, { Request, Response, NextFunction } from "express";
import createError, { HttpError } from "http-errors";
import cors from "cors";
import { apiRouter } from "./routers";

const app = express();

app.use(cors());
app.use(express.json());

app.use("/api", apiRouter);
Expand Down

0 comments on commit 4fa4191

Please sign in to comment.