Express MapExpress 應(yīng)用組件
Express Map 可以通過組裝 Express 應(yīng)用程序路徑配置,來與客戶端進行共享。
示例代碼:
// Map our paths using Express Map
app.map('/blog/', 'blog');
app.map('/blog/:post', 'blog-post');
// Annotate our paths using Express Annotations
app.annotate('/blog/', {section: 'blog'});
app.annotate('/blog/:post', {section: 'blog'});
// Set up our actual routes
app.get('/blog/', function (req, res) {
//Render the template for '/blog/' here});
app.get('/blog/:post', function (req, res) {
// Render the template for '/blog/:post' here});評論
圖片
表情
