Skip to content
Permalink
Browse files
adding koa cors
  • Loading branch information
skondram committed Nov 27, 2021
1 parent 38a7270 commit 61b37f8e6a93ed6487493221639dace861ddc764
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
@@ -1,6 +1,10 @@
const Koa = require('koa');
const cors = require('@koa/cors');
const app = new Koa();



app.use(cors());
/*
* Define route handler(s):
*

Some generated files are not rendered by default. Learn more.

@@ -13,6 +13,7 @@
"author": "Miltos",
"license": "ISC",
"dependencies": {
"@koa/cors": "^3.1.0",
"bcrypt": "^5.0.1",
"jsonschema": "^1.4.0",
"koa": "^2.13.4",
@@ -5,7 +5,9 @@ const auth = require('../controllers/auth');
const {validateUser} = require('../controllers/validation');
const can = require('../permissions/users');

const router = Router({prefix: '/api/v1/users'});
const prefix = '/api/v1/users';
const router = Router({prefix: prefix});


router.get('/', auth, getAll);
router.post('/', bodyParser(), validateUser, createUser);

0 comments on commit 61b37f8

Please sign in to comment.