0
const express = require('express');
const cors = require('cors');
const massive = require('massive');
const bodyParser = require('body-parser');
const config = require('../config');
const app = express();
app.use(bodyParser.json());
//massive connection string to database
massive(config.dblink).then(db => {
app.set('db', db)
app.get('db').seed_file().then(res => {
console.log(res)
})
}).catch(err => {
console.log(err)
});
const port = 3001;
app.listen(port,() => {console.log(`the server is listening on ${port}`)})
을 알아낼 수 없습니다 : 내가 잘못이 무엇인지 알아낼 수 없었다내가 처리되지 않은 약속 거부 오류를 받고 있어요하지만 난 다음 오류가있는 이유
(node:173676) UnhandledPromiseRejectionWarning: Unhandled promise rejection
(rejection id: 2): error: syntax error at or near "{"
(node:173676) [DEP0018] DeprecationWarning: Unhandled promise rejections are
deprecated. In the future, promise rejections that are not handled will
terminate the Node.js process with a non-zero exit code.
. 여러 다른 예제를 살펴 보았지만 문제를 볼 수는 없습니다. 내 seed_file
약속 후 .catch
이 있습니다.
의견이 있으십니까? 당신이 처리되지 않은 약속을 거부을 가지고 있기 때문에
. 그것을 삭제하면 좋을 것입니다. –
@MarkDodds 그렇지 않습니다. 코드 형식이 올바르지 않습니다. – codtex