Skip to content

Commit a065861

Browse files
authored
Merge pull request goitacademy#535 from goitacademy/small-fix
add small fix
2 parents a2e080b + 82f757b commit a065861

File tree

7 files changed

+10
-12
lines changed

7 files changed

+10
-12
lines changed

bin/server.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

model/index.js renamed to models/contacts.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// const fs = require('fs/promises')
2-
// const contacts = require('./contacts.json')
32

43
const listContacts = async () => {}
54

File renamed without changes.

nodemon.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"ignore": ["node_modules", "model/contacts.json"]
2+
"ignore": ["node_modules", "models/contacts.json"]
33
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {
6-
"start": "cross-env NODE_ENV=production node ./bin/server.js",
7-
"start:dev": "cross-env NODE_ENV=development nodemon ./bin/server.js",
6+
"start": "cross-env NODE_ENV=production node ./server.js",
7+
"start:dev": "cross-env NODE_ENV=development nodemon ./server.js",
88
"lint": "eslint **/*.js",
99
"lint:fix": "eslint --fix **/*.js"
1010
},

routes/api/contacts.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const express = require('express')
2+
23
const router = express.Router()
34

45
router.get('/', async (req, res, next) => {
@@ -17,7 +18,7 @@ router.delete('/:contactId', async (req, res, next) => {
1718
res.json({ message: 'template message' })
1819
})
1920

20-
router.patch('/:contactId', async (req, res, next) => {
21+
router.put('/:contactId', async (req, res, next) => {
2122
res.json({ message: 'template message' })
2223
})
2324

server.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const app = require('./app')
2+
3+
app.listen(3000, () => {
4+
console.log(`Server running. Use our API on port: ${PORT}`)
5+
})

0 commit comments

Comments
 (0)