玉和客户端的JavaScript

我刚开始学习使用jade作为渲染引擎的nodejs的Express,我有意见和路线

这是我的看法

layout.jade

doctype html html head title= title link(rel='stylesheet', href='/stylesheets/style.css') link(href='/themes/bootstrap.min.css', rel='stylesheet') script(src='/javascripts/mygridwidjet.js', type='text/javascript') body block content 

index.jade

 extends layout block content h1= title p Welcome to #{title} .content-container-fluid .row .cols-sample-area #Grid 

这是我的路线

index.js

 exports.index = function(req, res){ res.render('index', { title: 'Football Archive' }); }; 

我写了我的客户端JavaScript与#Grid交互

现在我真的很困惑在哪里把客户端JavaScript。

ps:我是一个总noob,对不起,如果这个问题是如此愚蠢。

你必须把它放在文件夹public/ (如果它不存在就创build它)

 myapp | |-node_modules/ | |-express/ | |-socket.io/ | |-public/ | |-javascripts/ | | |-mygridwidjet.js | |-... | |-server.js 

这是一个更复杂的例子(我的应用程序): https : //github.com/CraftYourModCorporation/RedstoneHub