Skip to content

Commit

Permalink
Merge pull request #4 from La-404-Devinci/dev
Browse files Browse the repository at this point in the history
👷 Update deployment script
  • Loading branch information
Kan-A-Pesh authored Feb 8, 2024
2 parents d2cc302 + 2a97f8f commit 5468337
Show file tree
Hide file tree
Showing 4 changed files with 2,655 additions and 2,606 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,15 @@ jobs:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
script: whoami && pwd && ls -al
script: |
cd ${{ secrets.DIR }}
git pull
cd frontend
npm install
npm run build
cd ../backend
npm install
npm run build
screen -S 404 -X quit
screen -S 404 -d -m npm start
echo "Deployed!"
35 changes: 35 additions & 0 deletions backend/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = __importDefault(require("express"));
const http_1 = __importDefault(require("http"));
const socket_io_1 = require("socket.io");
const dotenv_1 = __importDefault(require("dotenv"));
// Load environment variables from .env file
dotenv_1.default.config();
// Import route controllers
// TODO: Import the GetCanvas function from the CanvasController file
// import { GetCanvas } from "./controllers/CanvasController";
// TODO: Create others controllers for the user and auth routes
// Import websocket endpoints
// TODO: Import the PlacePixel function from the CanvasController file
// import { PlacePixel } from "./routes/canvas/CanvasController";
// TODO: Create others websocket endpoints for the user and auth routes
// Create Express app
const app = (0, express_1.default)();
const server = http_1.default.createServer(app);
// Create Socket.io server
const io = new socket_io_1.Server(server);
// // Express routes
// app.get("/canvas", GetCanvas);
// // Socket.io events
// io.on("connection", (socket: Socket) => {
// socket.on("placePixel", PlacePixel);
// });
// Start the server
const port = process.env.PORT || 3000;
server.listen(port, () => {
console.log(`Server is running on port ${port}`);
});
Loading

0 comments on commit 5468337

Please sign in to comment.