node.js - Package web static site to exe nodejs
问题描述
I have static site with some file below:
- index.html
- bundle.js
- images/some file
- some file font, and svg
Problem: I want to build an exe file to serve above file which should run on window.
When install exe file, program will run static site and other component can connect
Please suggest me a for me tool
解决方案
您可以使用 Web 服务器构建节点应用程序,然后您可以使用模块express.js
将代码和资产编译成 exe 文件pkg
使用 pkg 模块,您可以捆绑您的节点应用程序以在 windows、mac 或 linux 上运行。
要打包您的静态文件,pkg
您需要将资产目录添加到package.json
文档中提到的
"pkg": {
"assets": "your-assets-dir/**/*"
}
请点击这些链接,
如果你想为你可以使用的 windows 制作安装程序,inno script studio
推荐阅读
- ruby-on-rails - HAML 中的 SimpleForm
- javascript - Angular - 动态销毁组件,*ngIf 和 ComponentRef
- c# - 如何在 Microsoft botbuilder 对话框中检查 Bot 发布的消息?
- c# - 你能有带有限制条件的可选参数吗?
- c# - 从一个打开另一个表格
- php - 错误:无法 mkdir /usr/include/php/ext/imagick
- scala - 如何使用火花催化剂?
- python - 从某种意义上说,我如何在 ndarrays 中“处理”元素?
- db2 - IBM DB2,使用模式和表创建数据库的别名
- regex - PL/SQL 加速长函数