Questions tagged [koa-router]

Router middleware for koa.

Router middleware for koa.

https://github.com/alexmingoia/koa-router

139 questions
0
votes
1 answer

mongoose findbyId Internal error

I'm using Koa 2 and koa-router. The router file: import User from '../models/user' var router = require('koa-router')(); router .get('/', async ctx => ctx.body = await User.find({})) .get('/:id', async (ctx, next) => ctx.body = await…
user2670996
  • 2,654
  • 6
  • 29
  • 45
0
votes
1 answer

Does koa serve canceled requests?

I have a endpoint in koa, that loads much data from the database and then calculates some results based on it. This can take some seconds. What happens to a request, if the browser cancels it? Like the browser tab gets closed etc. For example, would…
K..
  • 4,044
  • 6
  • 40
  • 85
-1
votes
2 answers

Is it better to user const = require(); or import '' from ''; If yes, could you show me?

It looks like your post is mostly code; please add some more details.It looks like your post is mostly code; please add some more details.It looks like your post is mostly code; please add some more details.It looks like your post is mostly code;…
-2
votes
2 answers

JS Regex to match Chars with - or without -

I want to be able to match either of the following: unitedstatesofamerica united-states-of-america so match on chars with or without dashes, allow either. the purpose of this is so I can allow uris coming into my router to match on. for example I…
PositiveGuy
  • 17,621
  • 26
  • 79
  • 138
1 2 3
9
10