Javascript 使用express将css包含到html中

Javascript 使用express将css包含到html中,javascript,html,css,node.js,express,Javascript,Html,Css,Node.js,Express,我试图在我的简单html页面中包含一个css页面。 我正在使用parse.com托管来托管使用express的动态网页 关于这个问题有很多答案,但似乎没有一个对我有用 我试图用这行代码包含我的.ejs页面中的css文件 <link rel="stylesheet" type="text/css" href="css/content.css" /> 但它没有起作用 var express = require('express'); var app = express(); app.u

我试图在我的简单html页面中包含一个css页面。 我正在使用parse.com托管来托管使用express的动态网页

关于这个问题有很多答案,但似乎没有一个对我有用

我试图用这行代码包含我的.ejs页面中的css文件

<link rel="stylesheet" type="text/css" href="css/content.css" />
但它没有起作用

var express = require('express');
var app = express();
app.use(express.static(__dirname + '/public'));
// Global app configuration section
app.set('views', 'cloud/views');  // Specify the folder to find templates
app.set('view engine', 'ejs');    // Set the template engine


app.use(express.bodyParser());    // Middleware for reading request body



// This is an example of hooking up a request handler with a specific request
// path and HTTP verb using the Express routing API.

app.get('/content/:id', function(req, res) {


            res.render('content', {message: "hi"});

});
我按照本指南设置express:

当我尝试部署代码时,出现以下错误“更新失败,无法加载触发器。错误为ReferenceError:\uu dirname未定义”


我做错了什么?

在进一步研究这个问题之后,我在parse.com网站上读到了这篇文章

"our Express app can sit side-by-side with any static content you deployed from your public folder. When a request goes to a URL of your subdomain, Parse will first look for a matching file in the public directory. If there is no match, then Parse will invoke any Express request handlers that you have registered in Cloud Code. If there is still no match, Parse will render a "404 Not Found" page."
"our Express app can sit side-by-side with any static content you deployed from your public folder. When a request goes to a URL of your subdomain, Parse will first look for a matching file in the public directory. If there is no match, then Parse will invoke any Express request handlers that you have registered in Cloud Code. If there is still no match, Parse will render a "404 Not Found" page."