mu-semtech / mu-javascript-template

Template for running javascript/express microservices
4 stars 17 forks source link

Expose express router #32

Closed aatauil closed 3 years ago

madnificent commented 3 years ago

Hi @aatauil. Could you explain the use-case for this so we can evaluate and maybe add to the readme? Thanks :)

nvdk commented 3 years ago

I assume similar to what we do here: https://github.com/lblod/notulen-prepublish-service/blob/master/app.js, we just import express.router though. see https://github.com/lblod/notulen-prepublish-service/blob/master/routes/preview.js#L11

aatauil commented 3 years ago

Exactly as nvdk mentioned. Yeah I tried something similar to what you linked but for some reason it did not work while developing. I probably missed something and will retry tonight :)

aatauil commented 3 years ago

I had to fiddle arround a bit but I indeed got it to work :) FYI goal is to have each route function in a separate file instead of one long file with all routes and half a mile worth of imports at the top. Thankss guys