File tree Expand file tree Collapse file tree 5 files changed +1137
-118
lines changed Expand file tree Collapse file tree 5 files changed +1137
-118
lines changed Original file line number Diff line number Diff line change
1
+ name : " Deploy to 404 Server"
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+ - main
8
+
9
+ jobs :
10
+ deploy :
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - name : Deploy
14
+ uses : appleboy/ssh-action@v1.0.3
15
+ with :
16
+ host : ${{ secrets.HOST }}
17
+ username : ${{ secrets.USERNAME }}
18
+ key : ${{ secrets.KEY }}
19
+ script : whoami && pwd && ls -al
Original file line number Diff line number Diff line change
1
+ import express from "express" ;
2
+ import http from "http" ;
3
+ import { Server , Socket } from "socket.io" ;
4
+ import dotenv from "dotenv" ;
5
+
6
+ // Load environment variables from .env file
7
+ dotenv . config ( ) ;
8
+
9
+ // Import route controllers
10
+ // TODO: Import the GetCanvas function from the CanvasController file
11
+ // import { GetCanvas } from "./controllers/CanvasController";
12
+ // TODO: Create others controllers for the user and auth routes
13
+
14
+ // Import websocket endpoints
15
+ // TODO: Import the PlacePixel function from the CanvasController file
16
+ // import { PlacePixel } from "./routes/canvas/CanvasController";
17
+ // TODO: Create others websocket endpoints for the user and auth routes
18
+
19
+ // Create Express app
20
+ const app = express ( ) ;
21
+ const server = http . createServer ( app ) ;
22
+
23
+ // Create Socket.io server
24
+ const io = new Server ( server ) ;
25
+
26
+ // // Express routes
27
+ // app.get("/canvas", GetCanvas);
28
+
29
+ // // Socket.io events
30
+ // io.on("connection", (socket: Socket) => {
31
+ // socket.on("placePixel", PlacePixel);
32
+ // });
33
+
34
+ // Start the server
35
+ const port = process . env . PORT || 3000 ;
36
+ server . listen ( port , ( ) => {
37
+ console . log ( `Server is running on port ${ port } ` ) ;
38
+ } ) ;
You can’t perform that action at this time.
0 commit comments