Skip to content

Commit

Permalink
add:test
Browse files Browse the repository at this point in the history
  • Loading branch information
xizeyoupan committed Mar 4, 2023
1 parent a4319e2 commit 22fe0e5
Show file tree
Hide file tree
Showing 12 changed files with 2,087 additions and 53 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,23 @@ on:
default: false

jobs:
unit-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18

- run: npm i
- run: npm run build:all
- run: npm test

test-docker:
runs-on: ubuntu-latest
needs: [unit-test]

steps:
- uses: actions/checkout@v3

Expand Down
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Meting-API

https://m.boochinoob.shop/test
https://meting-dd.2333332.xyz/test

## 写在前面

Expand All @@ -27,14 +27,13 @@ Meting后端的api结构较为复杂,基础是一个[接口](https://github.co
- 插件系统,编写新接口及音源简单

## api网址

https://m.boochinoob.shop/api => cloudflare
https://meting-dd.2333332.xyz/api => Deno Deploy

https://meting-ve.2333332.xyz/api => vercel

https://meting-dd.2333332.xyz/api => Deno Deploy
https://m.boochinoob.shop/api => cloudflare (deprecated, see below)

可自行测试,如 https://m.boochinoob.shop/test
可自行测试,如 https://meting-dd.2333332.xyz/test

## 进度

Expand Down Expand Up @@ -102,10 +101,16 @@ docker run -d --name meting -p 3000:3000 intemd/meting-api:latest

### Cloudflare Workers

<details><summary>deprecated</summary>

由于cf会[自动去除x-real-ip以及在headers中加shit](https://developers.cloudflare.com/fundamentals/get-started/reference/http-request-headers/#cf-connecting-ip-in-worker-subrequests),网易云可能会失效。使用网易云的同学请尝试其他部署方式。

在全球拥有数据中心,提供的域名被阻断,使用自有域名后速度很快。冷启动速度很快。

fork本项目,依次点击actions/publish/run workflow。保持默认即可。待CI构建结束后下载cloudflare-workers.js并解压。在[Workers](https://dash.cloudflare.com)创建一个Service,点右上角Quick edit。把cloudflare-workers.js的内容复制进去deploy即可。

</details>

### Deno Deploy

类似Cloudflare Workers,但提供的域名未被阻断,使用Deno为runtime。
Expand Down Expand Up @@ -296,3 +301,7 @@ https://github.com/honojs/hono
https://github.com/honojs/node-server
https://github.com/camsong/fetch-jsonp
https://github.com/Binaryify/NeteaseCloudMusicApi
https://github.com/jsososo/QQMusicApi
20 changes: 19 additions & 1 deletion esbuild.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ await esbuild.build({
entryPoints: ['./app.js'],
bundle: true,
format: 'esm',
outfile: './dist/cloudflare-workers.js',
outfile: './dist/cloudflare-workers-min.js',
external: [],
plugins: [
resolve({
Expand All @@ -23,6 +23,24 @@ await esbuild.build({
minify: true,
});

await esbuild.build({
entryPoints: ['./app.js'],
bundle: true,
format: 'esm',
outfile: './dist/cloudflare-workers.js',
external: [],
plugins: [
resolve({
crypto: 'crypto-browserify'
}),
NodeGlobalsPolyfillPlugin({
process: true,
buffer: true,
}),
NodeModulesPolyfillPlugin(),
],
});

await esbuild.build({
entryPoints: ['./deno.js'],
bundle: true,
Expand Down
Loading

0 comments on commit 22fe0e5

Please sign in to comment.