Navigation

  • Recent
  • Tags
  • Users
  • Search
  • Login
Colyseus
  • Login
  • Search
  • Recent
  • Tags
  • Users

Documentation GitHub

We're migrating to GitHub Discussions. This forum does not accept new registrations since April 6, 2023.
  1. Home
  2. bamsutler
bamsutler

bamsutler

@bamsutler

Chat Follow Unfollow
1
Reputation
1
Posts
847
Profile views
0
Followers
0
Following
Joined 21 Mar 2019, 19:31 Last Online 22 Mar 2019, 14:26

  • Profile
  • More
    • Continue chat with bamsutler
    • Flag Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups
bamsutler Follow

Posts made by bamsutler

RE: POST method not allowed in express app after passing it to Colyseus constructor

Try reordering the declarations. ie

app.post('/signup', function (req, res) {
console.log(req.body);
console.log(res);
res.end();
})

// This is the Colyseus implementation
const gameServer = new Server({
server: createServer(app)
});

As far as I know express will process the hooks in the order they are declared so if colyseus is acting like a catch-all nothing after it will be processed. I am doing the same thing and I have all my HTTP handlers declared before the colyseus implementation.

posted in Questions & Help • 21 Mar 2019, 19:33

© 2023 Endel Dreyer