Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

133
Views
nanoExpress Ruta Separada

Quiero separar el directorio de rutas, pero no puedo y obtengo el siguiente error.

 rror [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './cjs' is not defined by "exports" in /mnt/.../projects/.../nanoexpress/node_modules/nanoexpress/package.json

aplicación.js

 const nanoexpress = require('nanoexpress'); var indexRouter = require('./routes/index'); const app = nanoexpress(); const port = 3333; app.get('/', (req, res) => { res.send('Hello World!') }) app.use('/testy',indexRouter) app.listen(port)

enrutadores/inde.js

 const nanoexpress = require('nanoexpress/cjs'); const Route = require('nanoexpress/cjs/Route'); const app = nanoexpress(); const testRoute = new Route(); testRoute.get('/route', async () => 'hello'); module.exports.testRoute = testRoute;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Mira esto. primero debe registrar la instancia de la ruta. Lea más aquí: https://nanoexpress.js.org/routes/route

Uso de instancia de ruta

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!