Skip to content

Commit

Permalink
use @colyseus/playground
Browse files Browse the repository at this point in the history
  • Loading branch information
endel committed Jun 2, 2023
1 parent 1d4c035 commit 200f353
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Usage Examples of Colyseus Game Server with Arena Hosting",
"main": "lib/index.js",
"scripts": {
"start": "ts-node-dev --respawn --transpile-only src/index.ts",
"start": "tsx watch src/index.ts",
"build": "npm run clean && tsc && node node_modules/copyfiles/copyfiles package.json ./lib && node node_modules/copyfiles/copyfiles arena.env ./lib && node node_modules/copyfiles/copyfiles -u 1 src/static/* ./lib",
"clean": "node node_modules/rimraf/bin lib",
"test": "echo \"Error: no test specified\" && exit 1"
Expand All @@ -20,14 +20,14 @@
"@types/express": "^4.17.14",
"copyfiles": "^2.4.1",
"rimraf": "^2.7.1",
"ts-node": "^8.1.0",
"ts-node-dev": "^1.0.0-pre.63",
"tsx": "^3.12.7",
"typescript": "^4.8.4",
"uwebsockets-express": "^1.1.14"
},
"dependencies": {
"@colyseus/tools": "^0.15.0",
"@colyseus/monitor": "^0.15.0",
"@colyseus/playground": "^0.15.2",
"@colyseus/tools": "^0.15.0",
"colyseus": "^0.15.0",
"cors": "^2.8.5",
"express": "^4.16.4",
Expand Down
11 changes: 4 additions & 7 deletions src/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import config from "@colyseus/tools";
import { monitor } from "@colyseus/monitor";
import { playground } from "@colyseus/playground";
import path from 'path';
import serveIndex from 'serve-index';
import express from 'express';
Expand All @@ -15,14 +16,10 @@ import { ReconnectionRoom } from './rooms/04-reconnection';
import { CustomLobbyRoom } from './rooms/07-custom-lobby-room';

export default config({
getId: () => "Your Colyseus App",

options: {
devMode: true,
},

// initializeTransport: (options) => new uWebSocketsTransport(options),

initializeGameServer: (gameServer) => {
// Define "lobby" room
gameServer.define("lobby", LobbyRoom);
Expand Down Expand Up @@ -67,10 +64,10 @@ export default config({
app.use('/', serveIndex(path.join(__dirname, "static"), {'icons': true}))
app.use('/', express.static(path.join(__dirname, "static")));

// app.use(serveIndex(path.join(__dirname, "static"), {'icons': true}))
// app.use(express.static(path.join(__dirname, "static")));
// (optional) client playground
app.use('/playground', playground);

// (optional) attach web monitoring panel
// (optional) web monitoring panel
app.use('/colyseus', monitor());
},

Expand Down

0 comments on commit 200f353

Please sign in to comment.