I have main page with link in it. When I am trying to open link 'porfolio.ejs' I get page with the message "Cannot GET/portfolio.ejs" Here is my index.js
var express = require('express');
var app = express();
app.set('port', (process.env.PORT || 5000));
app.use(express.static(__dirname + '/public'));
// views is directory for all template files
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.get('/', function(request, response) {
response.render('mainpage');
});
app.get('/portfolio', function(request, response) {
response.render('portfolio');
});
app.listen(app.get('port'), function() {
console.log('Node app is running on port', app.get('port'));
});
via Ulukbek Abylbekov
No comments:
Post a Comment