Skip to content

Commit

Permalink
Merge pull request #1 from harizinside/developer
Browse files Browse the repository at this point in the history
add cors and minify
  • Loading branch information
harizinside committed Feb 17, 2023
2 parents b2efc57 + 36cadfe commit d5f4b9f
Show file tree
Hide file tree
Showing 4 changed files with 243 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"presets": ["@babel/preset-env"],
"presets": ["@babel/preset-env", "minify"],
"ignore": ["node_module", "public"],
"plugins": [
[
"module-resolver",
Expand Down
237 changes: 236 additions & 1 deletion 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 @@ -12,8 +12,10 @@
"prod": "node ./dist/bin/www.js"
},
"dependencies": {
"babel-preset-minify": "^0.5.2",
"cookie-parser": "^1.4.6",
"core-js": "^3.27.1",
"cors": "^2.8.5",
"ejs": "^3.1.8",
"express": "^4.18.2",
"morgan": "^1.10.0",
Expand Down
4 changes: 3 additions & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import express from 'express';
import path from 'path';
import cookieParser from 'cookie-parser';
import logger from 'morgan';
import cors from 'cors';

import indexRouter from '@routes/index';
import usersRouter from '@routes/users';
Expand All @@ -13,6 +14,7 @@ app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');

app.use(logger('dev'));
app.use(cors())
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
Expand All @@ -37,4 +39,4 @@ app.use((err, req, res) => {
res.render('error');
});

export default app;
export default app;

0 comments on commit d5f4b9f

Please sign in to comment.