将位于/ views文件夹中的index.html设为networking服务器上的login页面

我想上传我的文件到一个networking服务器,在根文件夹中需要index.html来充当着陆页。 我的代码现在的方式,我的index.html必须在/视图文件夹。 有没有办法让它在index.html土地上,或者我必须将其移出并更改代码(如果是这样,如何?)我正在使用HTML / CSS,节点.js和expression。 最后2不是很好,但'不得不',因为我连接到一个数据库。 有人可以帮我吗?

我的文件夹结构如下所示:

/public /styles styles.css /views index.html twitter.html server.js package.json 

的script.js

 const express = require('express') const bodyParser = require('body-parser') const MongoClient = require('mongodb').MongoClient const path = require('path') const app = express() let db MongoClient.connect('mongodb://someuser:somepassword@cluster0-shard-00-00-fquoc.mongodb.net:27017,cluster0-shard-00-01-fquoc.mongodb.net:27017,cluster0-shard-00-02-fquoc.mongodb.net:27017/twitter?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin', (err, database) => { if (err) return console.log(err) db = database app.listen(3000, () => { console.log('listening on 3000') }) }) app.engine('html', require('ejs').renderFile) app.set('view engine', 'html') app.set('views', path.join(__dirname, 'views')); app.use(bodyParser.urlencoded({extended: true})) app.use(express.static(path.join(__dirname, 'public'))); app.get('/twitter', (req, res) => { db.collection('tweets').find().toArray((err, result) => { if (err) return console.log(err) res.render('twitter', {tweets: result}) }) }) app.get('/', (req, res) => { return res.render('index'); }); app.post('/tweets', (req, res) => { db.collection('tweets').save(req.body, (err, result) => { if (err) return console.log(err) console.log('saved to database') res.redirect('/twitter') }) }) 

index.html链接到twitter.html。 如果我要将index.html移动到根文件夹,我应该像这样链接到网站吗? views/twitter