feat: add initial API

This commit is contained in:
Morten Olsen
2025-10-16 20:54:31 +02:00
parent 5cf0a3612a
commit 11828da073
17 changed files with 647 additions and 89 deletions

View File

@@ -1,6 +1,6 @@
class Config {
public get jwtSecret() {
return process.env.TOKEN_SECRET;
return process.env.JWT_SECRET;
}
public get adminToken() {
@@ -38,14 +38,26 @@ class Config {
}
public get http() {
const enabled = (process.env.HTTP_ENABLED = 'true');
const port = process.env.HTTP_PORT ? parseInt(process.env.HTTP_PORT) : 8883;
return {
enabled,
port,
};
}
public get api() {
const enabled = process.env.API_ENABLED === 'true';
return {
enabled,
};
}
public get ws() {
const enabled = process.env.WS_ENABLED === 'true';
return {
enabled,
};
}
public get tcp() {
const enabled = (process.env.TCP_ENABLED = 'true');
const port = process.env.TCP_PORT ? parseInt(process.env.TCP_PORT) : 1883;