Move services.ts
This commit is contained in:
42
express/services/index.ts
Normal file
42
express/services/index.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
// services.ts
|
||||
|
||||
import { AuthService, InMemoryAuthStore } from "../auth";
|
||||
import { config } from "../config";
|
||||
import { getLogs, log } from "../logging";
|
||||
|
||||
//const database = Client({
|
||||
|
||||
//})
|
||||
|
||||
const database = {};
|
||||
|
||||
const logging = {
|
||||
log,
|
||||
getLogs,
|
||||
};
|
||||
|
||||
const random = {
|
||||
randomNumber: () => {
|
||||
return Math.random();
|
||||
},
|
||||
};
|
||||
|
||||
const misc = {
|
||||
sleep: (ms: number) => {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
},
|
||||
};
|
||||
|
||||
// Initialize auth with in-memory store
|
||||
const authStore = new InMemoryAuthStore();
|
||||
const auth = new AuthService(authStore);
|
||||
|
||||
const services = {
|
||||
database,
|
||||
logging,
|
||||
misc,
|
||||
random,
|
||||
auth,
|
||||
};
|
||||
|
||||
export { services };
|
||||
Reference in New Issue
Block a user