【发布时间】:2023-03-26 04:48:01
【问题描述】:
所以现在我有以下代码可以让“index.html”正确显示在: http://staging-supermodels.herokuapp.com/
但我的问题是如何更改它,以便在用户单击“登录”按钮时也显示我的其他文件(如 SignIn.html)?谢谢!
var express = require('express');
var fs = require('fs');
var app = express.createServer(express.logger());
var html_buffer = new Buffer(fs.readFileSync('index.html', 'utf-8'), 'utf-8');
var html_lines = html_buffer.toString("utf-8");
// public directory stores .css files
app.use(express.static(__dirname + '/css_files'));
// handler for dynamic content(webpages that change over time)
app.get('/', function(request, response) {
response.send(html_lines);
});
var port = process.env.PORT || 8080;
app.listen(port, function() {
console.log("Listening on " + port);
});
【问题讨论】:
标签: html node.js web-applications