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}`) )
我收到'语法错误:意外的输入结束'错误,这意味着某个地方缺少一个大括号或括号,但我找不到它。有人可以帮忙吗?
答案 0 :(得分:0)
我相信它就在这里
massive(config.dblink).then(db => {
app.set('db', db)
app.get('db').seed_file().then(res => {
console.log(res)
}).catch(err => {
console.log(err)
});
你还没有关闭另一个}