This commit is contained in:
CrescentLeaf
2025-07-14 22:26:13 +08:00
parent d235c84ef5
commit 89e730496f
7 changed files with 1912 additions and 33 deletions

View File

@@ -1,3 +1,7 @@
import config from './server/config.ts'
import io from './server/lib/io.js'
config.ensureAllDirsAreCreated()
io.copyDir('./client', config.dirs.WEB_PAGE_DIR)
await import('./server/build.ts').then(a => a.default(config.dirs.WEB_PAGE_DIR))

View File

@@ -10,11 +10,12 @@
// Front-end Compiling
"@babel/core": "npm:@babel/core@^7.26.10",
"@babel/preset-env": "npm:@babel/preset-env@^7.26.9",
"@babel/preset-react": "npm:@babel/preset-react@^7.26.3",
"babel-minify": "npm:babel-minify@^0.5.2"
"@babel/preset-react": "npm:@babel/preset-react@^7.26.3"
},
"tasks": {
// 編譯並運行
"run": "deno run --allow-read --allow-write --allow-import --allow-env --allow-net --allow-sys ./start-server.ts",
// 編譯前端頁面
"compile-webpage": "deno run --allow-read --allow-write --allow-import --allow-env ./compile-webpage.ts"
"compile-webpage": "deno run --allow-read --allow-write --allow-import --allow-env --allow-sys ./compile-webpage.ts"
}
}

1907
deno.lock generated

File diff suppressed because it is too large Load Diff

4
run.sh Normal file
View File

@@ -0,0 +1,4 @@
echo "主文件夾 = $HOME"
# mkdir usr_home || true
# HOME=./usr_home
deno task run

View File

@@ -11,11 +11,7 @@ function compileJs(path: string) {
},
],
"@babel/preset-react",
[
"minify", {
}
],
// "minify",
],
targets: {
chrome: "53",

View File

@@ -41,4 +41,8 @@ sio.on("connection", (socket) => {
})
})
httpApp.listen(80)
export {
app as expressApp,
httpApp as httpServer,
sio as SocketIoServer,
}

View File

@@ -0,0 +1,11 @@
import './compile-webpage.ts'
import {
expressApp,
httpServer,
SocketIoServer,
} from './server/http.ts'
httpServer.listen(8080)
console.log("TheWhiteSilk server started successfully")