[nodemon] Could not shutdown sub process cleanly
라는 에러가 계속 뜨는데 구글링해봐도 잘 안나와서요..왜이런 걸까요
처음 한번 nodemon 시작할때는 오류가 안나는데
다시 수정하면 오류가 떠서요ㅠㅠ
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({extended: true}));
const MongoClient = require('mongodb').MongoClient;
app.set('view engine', 'ejs');
MongoClient.connect('mongodb+srv://@cluster0.wtbbxyj.mongodb.net/?retryWrites=true&w=majority', function(에러, client){
if(에러){return console.log(에러)};
db = client.db('todoapp');
app.listen(7777, function(요청, 응답){
console.log('listening on 7777');
});
});
app.get('/', function(요청, 응답){
응답.sendFile(__dirname + '/index.html');
});
app.get('/write', function(요청, 응답){
응답.sendFile(__dirname + '/write.html');
});
app.post('/add', function(요청, 응답){
응답.send('전송완료');
db.collection('post').insertOne( { 제목 : 요청.body.title, 날짜 : 요청.body.date } , function(){
console.log('저장완료');
});
});
app.get('/list', function(요청, 응답){
db.collection('post').find().toArray(function(에러, 결과){
console.log(결과);
응답.render('list.ejs', { posts : 결과 });
});
});