feat(WechatSmallProject): 新增 微信小程序 课程(包含实验1-4)
This commit is contained in:
2
WechatSmallProject/test2/server/.gitignore
vendored
Normal file
2
WechatSmallProject/test2/server/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
pnpm-lock.yaml
|
||||
BIN
WechatSmallProject/test2/server/htdocs/01.mp4
Normal file
BIN
WechatSmallProject/test2/server/htdocs/01.mp4
Normal file
Binary file not shown.
BIN
WechatSmallProject/test2/server/htdocs/02.mp4
Normal file
BIN
WechatSmallProject/test2/server/htdocs/02.mp4
Normal file
Binary file not shown.
BIN
WechatSmallProject/test2/server/htdocs/03.mp4
Normal file
BIN
WechatSmallProject/test2/server/htdocs/03.mp4
Normal file
Binary file not shown.
9
WechatSmallProject/test2/server/index.js
Normal file
9
WechatSmallProject/test2/server/index.js
Normal file
@@ -0,0 +1,9 @@
|
||||
var express = require('express');
|
||||
|
||||
var app = express();
|
||||
|
||||
app.use(express.static('./htdocs'));
|
||||
|
||||
app.listen(3000, res => {
|
||||
console.log('服务器启动成功,访问地址:http://127.0.0.1:3000/文件名');
|
||||
});
|
||||
16
WechatSmallProject/test2/server/package.json
Normal file
16
WechatSmallProject/test2/server/package.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "music",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "node index.js"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"express": "^4.18.1",
|
||||
"multiparty": "^4.2.1",
|
||||
"serve-index": "^1.9.1"
|
||||
}
|
||||
}
|
||||
17
WechatSmallProject/test2/server/使用说明.txt
Normal file
17
WechatSmallProject/test2/server/使用说明.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
1. 准备工作
|
||||
安装Node.js
|
||||
启动命令行,切换工作目录到当前目录。
|
||||
|
||||
2. 执行如下命令,启动服务器
|
||||
node index.js
|
||||
|
||||
3. 将音频或视频文件放入htdocs目录
|
||||
|
||||
4. 获取文件链接
|
||||
|
||||
http://127.0.0.1:3000/文件名
|
||||
|
||||
如:
|
||||
http://127.0.0.1:3000/1.mp4
|
||||
http://127.0.0.1:3000/2.mp4
|
||||
|
||||
Reference in New Issue
Block a user