Young87

SmartCat's Blog

So happy to code my life!

游戏开发交流QQ群号60398951

当前位置:首页 >跨站数据测试

Express 实战: 使用 express-static 处理静态资源

Express 实战: 使用 express-static 处理静态资源

简介

本篇的出发点在于一直想测试 HTML 提供的 <script type="module"></script> 的功能,但是如果直接使用 files 协议访问本地的 html 文件,是不支持跨域 cors 请求的,在下面正文中会说明。

因此本篇介绍如何使用 express + express-static 直接实现一个简单的静态资源分发的简易前端服务器,马上来看看。

参考

node.js express 返回一个静态页面

除特别声明,本站所有文章均为原创,如需转载请以超级链接形式注明出处:SmartCat's Blog

上一篇: 【SSL_1377】竞赛真理 (分组背包)

下一篇: 【SSL_2291】分组背包

精华推荐

SmartCat.online

Slogan :No matter how hard the life is,we must be full of spirit

Address : Beijing

QQ :370334238

Email : 370334238@qq.com

CopyRight © 2010-2025 By SmartCat.online All rights reserved.鲁ICP备2020039140-1号