mirror of
https://github.com/MercuryWorkshop/adrift.git
synced 2025-05-13 06:10:01 -04:00
add tracker
This commit is contained in:
parent
0ffb386048
commit
23222b19db
11 changed files with 969 additions and 51 deletions
28
tracker/src/main.ts
Normal file
28
tracker/src/main.ts
Normal file
|
@ -0,0 +1,28 @@
|
|||
import dotenv from "dotenv";
|
||||
import express from "express";
|
||||
import expressWs from "express-ws";
|
||||
|
||||
|
||||
import serviceAccount from "./admin-creds.json";
|
||||
|
||||
import admin, { ServiceAccount } from "firebase-admin";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
|
||||
const app = express() as unknown as expressWs.Application;
|
||||
expressWs(app);
|
||||
|
||||
app.use(express.json());
|
||||
|
||||
|
||||
admin.initializeApp({
|
||||
credential: admin.credential.cert(serviceAccount as ServiceAccount),
|
||||
databaseURL: "https://adrift-6c1f6-default-rtdb.firebaseio.com"
|
||||
});
|
||||
|
||||
app.ws("/join", (ws: any, _req: any) => {
|
||||
console.log(ws, _req);
|
||||
});
|
||||
|
||||
app.listen(17776, () => console.log("listening"));
|
Loading…
Add table
Add a link
Reference in a new issue