Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #9

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/workflows/main_carubbi-snake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy Node.js app to Azure Web App - carubbi-snake

on:
push:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up Node.js version
uses: actions/setup-node@v1
with:
node-version: '16.x'

- name: npm install, build, and test
run: |
npm install



- name: Upload artifact for deployment job
uses: actions/upload-artifact@v2
with:
name: node-app
path: .

deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}

steps:
- name: Download artifact from build job
uses: actions/download-artifact@v2
with:
name: node-app

- name: 'Deploy to Azure Web App'
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'carubbi-snake'
slot-name: 'Production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_891E36B2E7C64F769A7C76009AA41D42 }}
package: .
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@
(original version from a youtube video linked below)
https://youtu.be/J42SZXS-_Qo

[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://travis-ci.org/joemccann/dillinger)

Fatures:


Live demo here:
https://carubbi-snake.herokuapp.com/frontend/snake.html

Live demo here: https://carubbi-snake.azurewebsites.net

## Features

Expand Down
7 changes: 5 additions & 2 deletions multiplayer/backend/server.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));

// select port according to environment
const port = process.env.PORT || 3000;

const options = {
index: "snake.html"
};
// listen to port 3000
httpServer.listen(port, function () {
// serve frontend game
app.use("/frontend", express.static(path.join(__dirname, '..', 'frontend')));

app.use("/", express.static(path.join(__dirname, '..', 'frontend'), options));

app.use("/scripts", express.static(path.join(__dirname, '..', 'scripts')));

Expand Down