ItzNotABug / appexpress

An express.js like framework for Appwrite Functions, enabling super-easy navigation!
Apache License 2.0
39 stars 4 forks source link

response.status is not a function #33

Closed dimasanwaraziz closed 3 months ago

dimasanwaraziz commented 3 months ago

For express 4.x status is res.status(500).json({ error: 'message' })

But I see on this documentation the response not include with status.

So when implement same code when switching from express to appexpress, it's return error.

image
ItzNotABug commented 3 months ago

Hey 👋 , AppExpress' syntax isn't completely same as express.js but rather similar to what Appwrite's Functions have.

You can do this way -

response.json({ error: 'message' }, 500)
ItzNotABug commented 3 months ago

Hey @dimasanwaraziz, Is your issue resolved now?

dimasanwaraziz commented 3 months ago

Yes, I can use the another way like you say.

But nice to have if we have that feature same like express.

ItzNotABug commented 3 months ago

Yes, I can use the another way like you say.

But nice to have if we have that feature same like express.

A fair point but express.js uses chaining which isn't what I'd prefer atm. I would instead like to keep it as close to the Appwrite Function's behaviour.