-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
33 lines (32 loc) · 1.02 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const host = "http://localhost";
const port = 3000;
const socketUrl = `${host}:${port}`;
const chatHistoryPath = `/chat-history`;
const chatHistoryUrl = `${host}:${port}${chatHistoryPath}`;
const firstAvailableUserIdPathWithAlias = `/next-id/:alias`;
const firstAvailableUserIdPath = `/next-id`;
const usersIdsAndAliasesPath = `/users-and-aliases`;
const usersIdsAndAliasesUrl = `${host}:${port}${usersIdsAndAliasesPath}`;
const getUserIdUrl = (alias = "") => `${host}:${port}/next-id/${alias}`;
const messageReceivedEvent = "message-received";
const messageSendEvent = "message";
const userAliasUpdateAttemptEvent = "user-alias-update-attempt";
const userAliasUpdateEvent = "user-alias-update";
const delay = 1000;
module.exports = {
host,
port,
socketUrl,
chatHistoryPath,
chatHistoryUrl,
usersIdsAndAliasesUrl,
firstAvailableUserIdPath,
getUserIdUrl,
messageReceivedEvent,
messageSendEvent,
delay,
userAliasUpdateAttemptEvent,
userAliasUpdateEvent,
usersIdsAndAliasesPath,
firstAvailableUserIdPathWithAlias,
};