Skip to content

Commit 107105e

Browse files
committed
remove font, applied cors, blocked duplicated fetch
1 parent 25bdf59 commit 107105e

34 files changed

+919
-936
lines changed

velog-backend/src/lib/middlewares/cors.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import type { Context } from 'koa';
44

55
export default (ctx: Context, next: () => Promise<*>) => {
66
ctx.set('Access-Control-Allow-Origin', 'https://velog.io');
7+
if (ctx.headers.referer && ctx.headers.referer.indexOf('localhost:5000') > -1) {
8+
ctx.set('Access-Control-Allow-Origin', 'http://localhost:5000');
9+
}
710
ctx.set('Access-Control-Allow-Credentials', (true: any));
811
return next();
912
};

velog-backend/src/router/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ router.use('/common', common.routes());
2828
router.get('/check', (ctx: Context) => {
2929
ctx.body = {
3030
version: '1.0.0-alpha.0',
31+
origin: ctx.origin,
3132
};
3233
});
3334

-222 KB
Binary file not shown.
-716 KB
Binary file not shown.
-274 KB
Binary file not shown.
-222 KB
Binary file not shown.
-710 KB
Binary file not shown.
-273 KB
Binary file not shown.
-225 KB
Binary file not shown.
-733 KB
Binary file not shown.

0 commit comments

Comments
 (0)