I'm trying Koa by using koa-static. But it keeps returning 404 (Body: Not Found) when using multilevel inclusion relationship. I don't know the reason.
To reproduce,
Windows 10 x64, Node v9.11.1
Koa v2.5.1, koa-compose v4.1.0, koa-static v4.0.3,…
I am looking for a a solution of a generalised error handing when using the library routing-controllers.
My custom error handling should be able to catch any rejected Promises coming from the Controller, build a response body from it and sets the…
I want to call an endpoint with a comma separated list, lets say I want to call with e.g.
"hey,you" or "hey,you,abc"
If I call with
curl "http://localhost:8896/hey,you"
it is working with the following route:
router.get('/:id([a-z]{3},[a-z]{3})',…
I'm trying to add blockDate into user db, but the code below doesn't make any changes. I checked out that data.username and blockDate are valid value. I get { ok: 0, n: 0, nModified: 0 } from res variable. how can I figure out what is wrong with…
I'm trying to require an external library in my Node app (Koa server). I'm adding njwt in my main server.js file var njwt = require('njwt');
But I can't access njwt, in my route handler function it gives an error saying njwt is undefined.
From this…
When I try to use koa-route 3.2.0 example from their website, I got error message router.routes is not a function
const Koa = require('koa');
const router = require('koa-route');
const app = new Koa();
app.use(logger());
router.get('/users', (ctx,…
Stack Overflow has a ton of questions regarding this error. Every one with its context. I have tried applying most of the solutions suggested but none is working. I am also new to koa and mongoose
"use strict"
const Koa = require('koa')
const Router…
If I send POST such /image/cover or /image/sub/ from client, the router function doesn't work at all so It sends 404. It's supposed to work but I literally have no idea. I never had this case It just doesn't work for no reason.
router
import Router…
I'm using Koa-better-body with Koa2, and I want to handle single file uploads in a POST form submission (input type=file).
While all the other fields show up properly under ctx.request.fields, i.e. ctx.request.fields.title, my file input's contents…
I'm using some module with koa and they only have this documentation which is written in koa v1 not v2. and since I've never used v1 before, I have no idea how to write this in v2.
app
.use(body({
IncomingForm: form
}))
.use(function * ()…
So I started my new project and a friend of mine conveiced me to ditch PHP and give Nodejs a try with rethinkDB.
I installed everything and without routes, it works. But once I add the routes, I got : Not Found with no error on the…
Using Koa and Koa-router, I write a function to accept POST on /videos and then save the video into HDFS(a distributed database). After the saving process finishing, the response should be sent to client saying that the uploading is finish. However,…
It seems like html breaks if I just render xml text using ctx.body because everything goes into body element not as raw xml. I read all the documentation but couldn't find proper response function for rendering xml.
This is my code and how it looks…
I just made simple koa app that returns rss xml by tag using parameter. and seems like middleware can't read router from router file. I have no idea why It doesn't work. I'm running this app.js with babel-node. and It keeps saying this error…
I reviewed and followed the guides of:
https://github.com/koajs/koa
https://github.com/alexmingoia/koa-router
https://github.com/saadq/koa-combine-routers/tree/next
I get 404 Not Found when attempting to use Named Parameters. What am I…