Questions tagged [koa]

Koa is a web framework which aims to be a smaller, more expressive, and more robust foundation for web applications and APIs.

Koa is a web framework for Node.js, designed by the team behind Express, aiming to be a smaller, more expressive, and more robust foundation for web applications and APIs.

Use this tag if your question is about the application middleware generators and its cascading properties or the use of App.Settings. Note also the existence of the tag if you're using the middleware API with async/await.

Resources

1232 questions
4
votes
1 answer

OpenShift not working with certain Nodejs dependencies (Koa)

I've checked out How to setup KoaJS in Openshift and it's still not working. Here is a part of my package.json file: "engines": { "node": ">= 0.12.0", "npm": ">= 1.0.0" }, "dependencies": { "co-busboy": "^1.3.0", "forever":…
basickarl
  • 37,187
  • 64
  • 214
  • 335
4
votes
2 answers

Bluebird instead of Co in Koa?

Seems like Bluebird overlaps Co in generator/coroutine related functionality. Bluebird is espoused to have exceptional speed-performance, so for discussion sake, (assuming the aforementioned overlap premise is true) if one wanted to substitute…
JLS
  • 691
  • 1
  • 6
  • 10
4
votes
1 answer

Using Koa, how do I get post variables

Let's say I want o get a simple variable posted to a Koa app without using an extension, how would I do it?
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
3
votes
3 answers

Strapi Plugin: api not accessible, getting not found in response

I want to create a custom api in strapi backend for that i generated a plugin which will help me to create a api for me ...so i created a plugin called test for testing purpose,when i try to access the test response in postman its showing 404 error…
yash singh
  • 31
  • 3
3
votes
0 answers

How to get raw request body in Strapi controller

Having trouble getting the request body in Strapi contoller. I am trying to send email(provider I am using is SendGrid) after user makes a POST request. Trying to make email dynamic. Post request body: { name:"testname", …
Nikasv
  • 1,317
  • 5
  • 17
  • 33
3
votes
1 answer

Unable to get SHOP name

In the previous version I used to get the current shop name is like this: router.get("/api/app", async (ctx) => { let shop = ctx.session.shop; }); but, in the new version, i can't get the current shop name using ctx.session.shop, i don't see any…
MHT
  • 37
  • 11
3
votes
0 answers

New Shopify session token drive me crazy

I tried to simply upgrade this https://github.com/Shopify/shopify-demo-app-node-react to use session token instead of cookies on Shopify. So i followed this guide https://github.com/Shopify/koa-shopify-auth Migrating from cookie-based authentication…
3
votes
0 answers

Generate both online and offline access token for a Shopify public app

Shopify's boilerplate app does this to generate an access token (online accessMode by default) server.use( createShopifyAuth({ apiKey: SHOPIFY_API_KEY, secret: SHOPIFY_API_SECRET, scopes: [SCOPES], async afterAuth(ctx)…
harishannam
  • 2,747
  • 3
  • 30
  • 39
3
votes
1 answer

TypeORM logging - enabled but no output

Simple issue. Typeorm doesn't log anything. I've followed the instructions on https://orkhan.gitbook.io/typeorm/docs/logging ormconfig.json { "type": "mongodb", "host": "aaa", "port": 27017, "username": "bbb", "password": "ccc", "ssl":…
Jason
  • 412
  • 1
  • 6
  • 13
3
votes
3 answers

Koa - Catch all routes that start with prefix

I was wondering how can we catch all API call of a specific route with KOA-Router. For example. I have an api designed like this : /api/ /api/user/ /api/user/create /api/user/login /api/user/delete How can I trigger the route /api/ for all calls…
Tryall
  • 640
  • 12
  • 22
3
votes
0 answers

Is there a way to pass a value only for a second generic but not first one which has default value in typescript?

Koa Middleware type definition // @types/koa type Middleware = compose.Middleware< ParameterizedContext >; Expect // src/middleware/cookie.ts import { ExtendableContext,…
3
votes
1 answer

Shopify App - Script Tag - CORS error when retrieving data from store

Overview I have a custom REST API within my Koa server and I can access it just fine within my Shopify app using react. However, when I try to access it from my Script Tag, I get a CORS error. Issue I can't access my custom REST API data from the…
Diego Fortes
  • 8,830
  • 3
  • 32
  • 42
3
votes
2 answers

Shopify CLI using Typescript

I would like to test out building out a shopify app using Typescript by starting with the shopify-app-cli boilerplate, which uses Koa as a server and Nextjs for the front end react javascript. see https://github.com/Shopify/shopify-app-cli I am…
Azhop
  • 51
  • 2
  • 6
3
votes
1 answer

Elasticsearch responding blank _source

I am using @elastic/elasticsearch library in my node project and i am trying to create an index like this const { Client } = require('@elastic/elasticsearch') const client = new Client({ node: 'http://localhost:9200' }) await client.index({ …
vivek jha
  • 344
  • 1
  • 11
3
votes
0 answers

Mermaid.js with Node.js - Dynamically generation

I am working with Mermaid.js to general a Class Diagram for my hobby project. I am facing a very basic issue, which I cannot figure out how should I approach it. Basically, I have the structure generated, but when I push it to the view, it is…
lancegoh
  • 624
  • 1
  • 6
  • 16