Reputation: 51
I've been using Node over 2 years, never seen this case before. when I run lsof -i tcp:8080
,There's literally nothing used in 8080 port. I also tried killall -9 node
and sudo fuser -k 8080/tcp
but the stil same error.
but when I run my Node appIt occurs the error. No idea why this happens. any Ideas?
app.js
const app = new Koa()
const port = process.env.PORT || 8080
const dist = isProduction() ? __dirname + '/../views' : __dirname + '/views/'
const bpOption = {
fields: 'body',
IncomingForm: form
}
console.log("SIBAL")
app.keys = ['secret', 'key'];
require('./util/passport')
app
.use(logger())
.use(serve(dist))
.use(session({}, app))
.use(bodyParser(bpOption))
.use(passport.initialize())
.use(passport.session())
.use(views(dist, { extension: 'pug'}))
.use(routes())
let server = app.listen(port)
Upvotes: 0
Views: 2312