我使用Node和Express创建了一个简单的节点js应用程序。它只是用来提供几个静态文件。它正在提供文件
http://localhost:3000/index
http://localhost:3000/users
但我想用项目名称来提供它。有些事情如下
http://localhost:3000/myNodeProject/index
http://localhost:3000/myNodeProject/index
我该怎么做?
我的代码
var express = require('express');
var path = require('path');
var routes = require('./routes/index');
var users = 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')));
//Routers or HTTP Rest Requests
app.use('/', routes);
app.use('/users', users);
var server = http.createServer(app);