fix startup
This commit is contained in:
parent
8cf11f6613
commit
49cce47f4c
2
main.ts
2
main.ts
|
|
@ -3,4 +3,4 @@ import { spawn } from "bun"
|
|||
|
||||
const run = (cmd: string[]) => spawn(cmd, { stdout: "inherit", stderr: "inherit" }).exited
|
||||
|
||||
await Promise.all([run(["bun", "http"]), run(["bun", "bot:discord"])])
|
||||
await Promise.all([run(["bun", "bot:discord"]), run(["bun", "http"])])
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
"semi": false
|
||||
},
|
||||
"scripts": {
|
||||
"http": "bun run --filter=@the-rabbit-hole/http dev",
|
||||
"http": "bun run --filter=@the-rabbit-hole/http start",
|
||||
"bot:cli": "bun run --filter=@the-rabbit-hole/spike bot:cli",
|
||||
"bot:discord": "bun run --filter=@the-rabbit-hole/spike bot:discord",
|
||||
"start": "bun run main.ts"
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@
|
|||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "bun run --hot src/server"
|
||||
"dev": "bun run --hot src/server",
|
||||
"start": "bun run src/server"
|
||||
},
|
||||
"prettier": {
|
||||
"printWidth": 110,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { serve } from "bun"
|
|||
import { nanoRemix } from "@the-rabbit-hole/nano-remix"
|
||||
import { join } from "node:path"
|
||||
|
||||
serve({
|
||||
const server = serve({
|
||||
routes: {
|
||||
"/*": (req) => nanoRemix(req, { routesDir: join(import.meta.dir, "routes") }),
|
||||
},
|
||||
|
|
@ -12,3 +12,5 @@ serve({
|
|||
console: true,
|
||||
},
|
||||
})
|
||||
|
||||
console.log(`🤖 Server running at ${server.url}`)
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ const writeStore = (store: Record<string, any>): void => {
|
|||
}
|
||||
|
||||
const getStorePath = (): string => {
|
||||
const rootDir = join(import.meta.dir, "..")
|
||||
const rootDir = process.env.DATA_DIR ?? join(import.meta.dir, "..")
|
||||
const store = join(rootDir, "data/kv.json")
|
||||
return store
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user