Skip to content

Commit 66104f3

Browse files
committed
feat: remove env variable PUBLIC_DIR
We can automatically deduce the value of this variable, so no need to explicitly configure it in the env files.
1 parent 6b069ca commit 66104f3

File tree

5 files changed

+9
-1
lines changed

5 files changed

+9
-1
lines changed

.env.example

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ APP_URL=http://localhost:3000/
22
COOKIE_DOMAIN=localhost
33
COOKIE_SECURE=false
44
DATA_DIR=~/.local/state/keybr
5-
PUBLIC_DIR=~/keybr.com/root/public
65

76
DATABASE_CLIENT=sqlite
87
DATABASE_FILENAME=~/.local/state/keybr/database.sqlite

packages/server/lib/main.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import cluster, { type ClusterSettings } from "node:cluster";
22
import { Application } from "@fastr/core";
33
import { Container } from "@fastr/invert";
4+
import { Manifest } from "@keybr/assets";
45
import { ConfigModule, Env } from "@keybr/config";
56
import { Logger } from "@keybr/logger";
67
import { Game } from "@keybr/multiplayer-server";
@@ -53,6 +54,7 @@ function makeContainer() {
5354
container.load(new ConfigModule());
5455
container.load(new ApplicationModule());
5556
container.load(new ServerModule());
57+
container.get(Manifest); // Sanity check.
5658
return container;
5759
}
5860

root/_config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"use strict";
2+
3+
const { join } = require("node:path");
4+
5+
process.env.PUBLIC_DIR = join(__dirname, "public");

root/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
"use strict";
44

5+
require("./_config.js");
56
require("./lib/index.js");

root/keybr.js

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
"use strict";
44

5+
require("./_config.js");
56
require("./lib/keybr.js");

0 commit comments

Comments
 (0)