Init database on daemon startup
This commit is contained in:
parent
2082a908fa
commit
ef4b4b06e2
1 changed files with 4 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { initDb } from "./db";
|
||||||
import { decode } from "./protocol";
|
import { decode } from "./protocol";
|
||||||
import {
|
import {
|
||||||
type Client,
|
type Client,
|
||||||
|
|
@ -8,6 +9,9 @@ import {
|
||||||
|
|
||||||
const PORT = Number(process.env.PORT) || 4040;
|
const PORT = Number(process.env.PORT) || 4040;
|
||||||
|
|
||||||
|
// Initialize database
|
||||||
|
initDb("collabd.db");
|
||||||
|
|
||||||
function isValidRoomName(name: unknown): name is string {
|
function isValidRoomName(name: unknown): name is string {
|
||||||
if (typeof name !== "string") return false;
|
if (typeof name !== "string") return false;
|
||||||
if (name.length === 0 || name.length > 64) return false;
|
if (name.length === 0 || name.length > 64) return false;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue