Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Voting
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dennis Willers
Voting
Commits
3272034b
Commit
3272034b
authored
Aug 23, 2021
by
Matthieu - Greep
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add cookie-parser, morgan, eslint
parent
61714741
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3900 additions
and
46 deletions
+3900
-46
index.js
index.js
+13
-8
package-lock.json
package-lock.json
+3884
-38
package.json
package.json
+3
-0
No files found.
index.js
View file @
3272034b
require
(
'
./socket
'
);
require
(
'
dotenv
'
).
config
();
const
express
=
require
(
'
express
'
);
const
cors
=
require
(
'
cors
'
);
const
bodyParser
=
require
(
'
body-parser
'
);
const
mysql
=
require
(
'
mysql
'
);
const
events
=
require
(
'
./events
'
);
const
express
=
require
(
'
express
'
),
cors
=
require
(
'
cors
'
),
logger
=
require
(
'
morgan
'
),
cookieParser
=
require
(
'
cookie-parser
'
),
mysql
=
require
(
'
mysql
'
),
//events = require('./events'),
path
=
require
(
'
path
'
),
fs
=
require
(
'
fs
'
);
const
connection
=
mysql
.
createConnection
({
host
:
process
.
env
.
DB_HOST
,
port
:
process
.
env
.
DB_PORT
,
...
...
@@ -20,9 +23,11 @@ connection.connect();
const
port
=
process
.
env
.
PORT
||
8080
;
const
app
=
express
()
.
disable
(
'
etag
'
)
.
use
(
cors
())
.
use
(
bodyParser
.
json
())
.
use
(
events
(
connection
));
.
use
(
express
.
json
())
.
use
(
cookieParser
())
.
use
(
logger
(
'
(:date) :method :url - ":user-agent" (:remote-addr) - :status :response-time ms
'
));
app
.
listen
(
port
,
()
=>
{
console
.
log
(
`Express server listening on port
${
port
}
`
);
...
...
package-lock.json
View file @
3272034b
This source diff could not be displayed because it is too large. You can
view the blob
instead.
package.json
View file @
3272034b
...
...
@@ -13,12 +13,15 @@
"license"
:
"
ISC
"
,
"dependencies"
:
{
"
axios
"
:
"
^0.21.1
"
,
"
cookie-parser
"
:
"
^1.4.5
"
,
"
cors
"
:
"
^2.8.5
"
,
"
dotenv
"
:
"
^10.0.0
"
,
"
express
"
:
"
^4.17.1
"
,
"
morgan
"
:
"
^1.10.0
"
,
"
mysql
"
:
"
^2.18.1
"
},
"devDependencies"
:
{
"
eslint
"
:
"
^7.32.0
"
,
"
nodemon
"
:
"
^2.0.7
"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment