This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('./index') | |
, TempSchema = new mongoose.Schema({ | |
salutation: {type: String, enum: ['Mr.', 'Mrs.', 'Ms.']} | |
}); | |
var Temp = mongoose.model('Temp', TempSchema); | |
console.log(Temp.schema.path('salutation').enumValues); | |
var temp = new Temp(); | |
console.log(temp.schema.path('salutation').enumValues); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<h1>Here are all the fruits!</h1> | |
<a href="/fruits/new">add fruit (+)</a> | |
<% fruits.forEach((fruit, index) => { %> | |
<li> | |
<a href="/fruits/<%= index %>"> <%= fruit.name %> </a> | |
</li> | |
<% }); %> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.use(function (req, res) { | |
// any get will send 404 | |
if (req.method === "GET") return res.status(404).send("404 Page Not Found"); | |
// any other method will say not allowed | |
return res.status(405).send("Method not allowed"); | |
}); |
NewerOlder