Skip to content

Commit d2cc302

Browse files
authored
Merge pull request #3 from La-404-Devinci/dev
2 parents 90e0f54 + 0f03cbf commit d2cc302

File tree

5 files changed

+1137
-118
lines changed

5 files changed

+1137
-118
lines changed

.github/workflows/main.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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

backend/index.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
});

0 commit comments

Comments
 (0)