#How to connect expressjs with nuxt3

26 messages · Page 1 of 1 (latest)

amber pier
weary kiln
#

🤔 why not the nitro server ? Which is already present in nuxt 3 ?

amber pier
#

Can you show me api example using it?

#

I am currently switching to nuxt3

spark scarab
#

I'd also suggest using Nitro directly ☺️

amber pier
#

thanks

signal frigate
#

could sound dumb but I'm new to the JS environment so in there you put like database queries or whatever that return JSON ?

spark scarab
#

Could be a DB query, another API call and more

quasi plaza
#

I'm trying to use https://adminjs.co/ to generate an automatic CRUD dashboard for my app.

adminjs has several adapters for popular frameworks, express, fastify, etc., but not h3

integrating it with express is pretty trivial, so I thought that was the direction i'd try here, but I can use some help with this

the express integration works by creating an express router

river terrace
quasi plaza
#

actually, getting express to work was pretty easy

export default fromNodeMiddleware(expressApp)

river terrace
#

@quasi plaza yeah it's great that it works, just not needed 😄

quasi plaza
#

in my case it's needed cause there's no adapter for adminjs

#

so I need to use express, fastify, koa, etc.

fallen frost
#

@river terrace i think what most people miss in general in the JS community is the concept of supporting apis, just because it is not needed by you or someone on a greenfield project does not mean it is not needed by people in existing projects

#

Everything is "rewrite and new" so instead of supporting well established community standards (like the express api) we have several "new shiny" things like h and nitro and probably other things i'm unaware of. Those new things should adapt the existing behavior as a first class concern

#

as is in the documentation there is no support for async express function, which excludes entire ecosystems like koa

spark scarab
#

(Also, h3 has built-in async support)

harsh briar
fallen frost
fallen frost
rancid knot
#

Use a nuxt 2 api from nuxt 3 👍

fallen frost
#

Example question for modules: #modules message