Navigation

    Colyseus
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Users
    1. Home
    2. bamsutler
    bamsutler

    bamsutler

    @bamsutler

    Chat Follow Unfollow
    1
    Reputation
    1
    Posts
    482
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    • 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 •