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. kappacoder
kappacoder

kappacoder

@kappacoder

Chat Follow Unfollow
0
Reputation
3
Posts
1.1k
Profile views
0
Followers
0
Following
Joined 17 Mar 2019, 15:08 Last Online 24 Mar 2019, 09:41

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

Posts made by kappacoder

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

Oh god, that actually solved it! Thank you very much! I thought I was going crazy :D

posted in Questions & Help • 22 Mar 2019, 18:52
RE: POST method not allowed in express app after passing it to Colyseus constructor

Hey, still no answer to my issue. If anyone out there has any idea, I'd be really grateful.

Thanks! :)

posted in Questions & Help • 21 Mar 2019, 18:52
POST method not allowed in express app after passing it to Colyseus constructor

I am trying to add a POST route to my express app which is also using Colyseus.
Here is a demo code:

const app = express();

// This should add POST in the Allow request headers
app.use(cors());
app.options('*', cors());

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

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

When I make a POST request using Postman I receive error 405: Method not allowed
In the headers I see this:
Allow →GET, HEAD, OPTIONS

So it seems that POST does not work... When I remove Colyseus and only use the app, the POST requests work.

Any idea how to fix this, I'd be really grateful.

posted in Questions & Help • 17 Mar 2019, 15:15

© 2023 Endel Dreyer