我已经准备好快递应用程序,但是我需要将其作为电子应用程序运行。
我的app.js文件是这样的:
var express = require('express');
var app = express();
var path = require('path');
var session = require('express-session');
var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');
var app = express();
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
app.use(express.static(path.join(__dirname, 'public')));
app.use(express.static(path.join(__dirname, 'controller')));
app.use('/', indexRouter);
app.use('/users', usersRouter);
app.listen(2000, () => {
console.log('server running at port : 2000');
});
module.exports = app;
如何在电子中运行此代码?