pan93412
|
6681f11ce0
|
fix: add "server.js" to the filelist to pack
目前的 NPM 包少了 server.js,會導致
"NeteaseCloudMusicApi/server" 找不到檔案,也會讓
npx NeteaseCloudMusicApi 報錯(找不到 server.js 模組)
|
2022-01-29 22:27:17 +08:00 |
|
pan93412
|
b02d4d5e04
|
refactor: allow using server statically
將原本 "NeteaseCloudMusicApi/server"
掃描 modules 目錄的部分抽出 server.js,
改移到 main.js。這樣使用者就有辦法只載入
靜態的伺服器部分(不動態載入模組)。
這個 patch 的 breaking changes 不易發生。
可作為 patch version 發佈。
|
2022-01-28 12:52:21 +08:00 |
|
pan93412
|
69a71cb710
|
chore: add a tool to get the static module definitions
|
2022-01-26 14:50:50 +08:00 |
|
pan93412
|
c412f53f11
|
feat(server): allow printing out module paths
|
2022-01-26 14:42:50 +08:00 |
|
pan93412
|
7061a9ea82
|
refactor!: use server.js as main.js
server.js 有 main.js 原本的功能 (getModulesDefinitions)
BREAKING CHANGES: 所有使用到這個 lib 的應用程式
,皆需更改為 .getModulesDefinitions()。
|
2022-01-26 14:34:35 +08:00 |
|
pan93412
|
9e0c900f6f
|
test(server): more reliable test for server
|
2022-01-26 14:30:00 +08:00 |
|
pan93412
|
4e434a2691
|
feat(server): add field "identifier"
I'm going to replace the function of "main.js".
|
2022-01-26 14:20:54 +08:00 |
|
pan93412
|
5bf53028ef
|
feat(server): allow passing modules manually
自行維護 require 名單以相容 Webpack。
|
2022-01-26 14:14:24 +08:00 |
|
pan93412
|
fc9630aa39
|
refactor: add type definition of Express
|
2022-01-26 11:52:46 +08:00 |
|
pan93412
|
fb04e512c0
|
fix(server): remove the shebang line
|
2022-01-26 11:38:08 +08:00 |
|
pan93412
|
0ac00325c8
|
refactor(server): replace the deprecated function
Express 4.x 以上版本已經內建 body-parser。
|
2022-01-26 11:34:35 +08:00 |
|
pan93412
|
7985690987
|
refactor(server): separate server from app
我們需要 NCM API 的伺服器部分,但 app.js
目前的做法讓我們不太好單獨啟動伺服器。
我將 app.js 的伺服器部分抽成各個函數,並將原有
會 blocking 的函數更改為非同步函式。
這樣不僅能最大化善用 Node.js 的 Event Loop,
亦能提升未來維護的程式碼易讀性。
|
2022-01-26 11:29:07 +08:00 |
|