Files
2018-10-16 21:32:40 +05:30

17 lines
619 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Serve Static Assets
localeTitle: 服务静态资产
---
## 服务静态资产
静态网页使用express非常简单。这对于构建自己的投资组合网站或博客等非常有用。
要从“views”文件夹提供静态网页您可以使用以下代码
```javascript
const express = require("express");
const app = express();
app.use(express.static(__dirname + "/views"));
```
[帮助我们的社区扩展这些提示和指南](https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/apis-and-microservices/basic-node-and-express/meet-the-node-console/index.md) 。