I've created a file called ships.js
in my routes folder:
var express = require('express');
var router = express.Router();
/* GET Ships page. */
router.get('/ships', function(req, res, next) {
res.render('ships', { title: 'Express' });
});
module.exports = router;
In my app.js
, I included these two statements:
var routes = require('./routes/index');
var users = require('./routes/users');
var ships = require('./routes/users');
and
app.use('/', routes);
app.use('/ships', ships);
app.use('/users', users);
When I visit localhost:3000/ships
, instead of the expected output, I see the message:
respond with a resource
Despite reading the documentation, I'm still trying to figure out how to properly use Express.