Skip to content

Commit 946829a

Browse files
committed
initial commit
0 parents  commit 946829a

File tree

3 files changed

+167
-0
lines changed

3 files changed

+167
-0
lines changed

.gitignore

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
.sass-cache/
2+
*.css.map
3+
*.sass.map
4+
*.scss.map
5+
6+
# Logs
7+
logs
8+
*.log
9+
npm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
lerna-debug.log*
13+
14+
# Diagnostic reports (https://nodejs.org/api/report.html)
15+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
16+
17+
# Runtime data
18+
pids
19+
*.pid
20+
*.seed
21+
*.pid.lock
22+
23+
# Directory for instrumented libs generated by jscoverage/JSCover
24+
lib-cov
25+
26+
# Coverage directory used by tools like istanbul
27+
coverage
28+
*.lcov
29+
30+
# nyc test coverage
31+
.nyc_output
32+
33+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
34+
.grunt
35+
36+
# Bower dependency directory (https://bower.io/)
37+
bower_components
38+
39+
# node-waf configuration
40+
.lock-wscript
41+
42+
# Compiled binary addons (https://nodejs.org/api/addons.html)
43+
build/Release
44+
45+
# Dependency directories
46+
node_modules/
47+
jspm_packages/
48+
49+
# TypeScript v1 declaration files
50+
typings/
51+
52+
# TypeScript cache
53+
*.tsbuildinfo
54+
55+
# Optional npm cache directory
56+
.npm
57+
58+
# Optional eslint cache
59+
.eslintcache
60+
61+
# Microbundle cache
62+
.rpt2_cache/
63+
.rts2_cache_cjs/
64+
.rts2_cache_es/
65+
.rts2_cache_umd/
66+
67+
# Optional REPL history
68+
.node_repl_history
69+
70+
# Output of 'npm pack'
71+
*.tgz
72+
73+
# Yarn Integrity file
74+
.yarn-integrity
75+
76+
# dotenv environment variables file
77+
.env
78+
.env.test
79+
80+
# parcel-bundler cache (https://parceljs.org/)
81+
.cache
82+
83+
# Next.js build output
84+
.next
85+
86+
# Nuxt.js build / generate output
87+
.nuxt
88+
dist
89+
90+
# Gatsby files
91+
.cache/
92+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
93+
# https://nextjs.org/blog/next-9-1#public-directory-support
94+
# public
95+
96+
# vuepress build output
97+
.vuepress/dist
98+
99+
# Serverless directories
100+
.serverless/
101+
102+
# FuseBox cache
103+
.fusebox/
104+
105+
# DynamoDB Local files
106+
.dynamodb/
107+
108+
# TernJS port file
109+
.tern-port
110+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
111+
112+
# dependencies
113+
/node_modules
114+
/.pnp
115+
.pnp.js
116+
117+
# testing
118+
/coverage
119+
120+
# production
121+
/build
122+
123+
# misc
124+
.DS_Store
125+
.env.local
126+
.env.development.local
127+
.env.test.local
128+
.env.production.local
129+
130+
npm-debug.log*
131+
yarn-debug.log*
132+
yarn-error.log*

db/connect.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const mongoose = require('mongoose')
2+
3+
const connectDB = (url) => {
4+
return mongoose.connect(url, {
5+
useNewUrlParser: true,
6+
useCreateIndex: true,
7+
useFindAndModify: false,
8+
useUnifiedTopology: true,
9+
})
10+
}
11+
12+
module.exports = connectDB

package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "jwt-example",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "app.js",
6+
"scripts": {
7+
"start": "nodemon index.js"
8+
},
9+
"keywords": [],
10+
"author": "",
11+
"license": "ISC",
12+
"dependencies": {
13+
"dotenv": "^8.2.0",
14+
"express": "^4.17.1",
15+
"express-async-errors": "^3.1.1",
16+
"http-status-codes": "^2.1.4",
17+
"jsonwebtoken": "^8.5.1",
18+
"mongoose": "^5.11.10"
19+
},
20+
"devDependencies": {
21+
"nodemon": "^2.0.7"
22+
}
23+
}

0 commit comments

Comments
 (0)