const session = require( koa-session ) const redis = require( koa-redis ) how do you write your configuration? Can you post the code? ...
nodemailer "nodemailer ": "^4.6.8 ",501QQ501 let transporter = nodeMailer.createTransport ({ host:Email.smtp.host, port:465, secure:true, auth:{ user:Email.smtp.user, pass:Email.smtp.pass, } }) let ko = { c...
because it is time-consuming to run, you need to return a result first. Is there any way for koa to implement other operations? ...
problem description version: koa@1.2.2,mongoose@5.4.1 request test . The doc that is queried and returned has information, but the front end always prompts interface 404 whether to return the data queried in the database asynchronously, but doe...
upload the file according to a koa2 written in the online tutorial and install the koa-body. Postman is used for testing, but an error is reported. The console shows that ctx.request.body.files is undefined ctx.request.body{} ctx.request . ...
problem description Local front-end separation project front-end address localhost:2018 back-end address localhost:3020 framework koa2 when the current end accesses an interface at the backend, the cookie cannot be written to the browser the envi...
koa API: http: xxx,xxxxxx.com weapp t. Direct address bar access display 404 it should be that nuxt accesses the weapp token page under the page project by default. If I want to access the koa interface in the address bar, how can I? ...
this is the code for forwarding, but the front end of ctx.response.body is 404 . router.get( getData , async (ctx, next) => { let opts = Object.keys(ctx.query).reduce((pre, item, index) => { return pre += `${item}=${encodeURIComponent(ct...
the concept of middle layer has been put forward for a long time, but there has been no practical operation. I have written a personal website with koa, so there is a certain foundation. Using the middle layer can mainly reduce the energy consumption of ...
mainly adds permission page control to the backend management system. For example, administrators can access all pages, while junior staff can only access some pages . the main problem is how to control the page in the middleware. In the vue set I curr...
< template > <div @click="loginFn">aaaa< div> < template > < script > export default { data () { return { } }, methods: { loginFn () { alert(1) console.log( hehe ) } }, mounted () {...
Abstract a Mongodb instance module in koa2. mongoUtil.js const MongoClient = require( mongodb ).MongoClient; async function getMongoDB() { try { const client = await new MongoClient( mongodb: localhost:27017 test ).connect(); db = cl...
const router = require( koa-router )(); const fs = require( fs ); router.post( upload , async (ctx){ const file = ctx.request.body.files.file; const reader = fs.createReadStream(file.path); const ext = file.name.split( ...
Can the nuxt.js+koa page get asynchronous data only by requesting an interface in asyncData? Can replace data directly from the server to HTML in the form of a template? in the form of node+ejs, if you can only request data through an interface, doesn ...
electron-vue, opens the server, of koa in the rederer thread and asks how to configure webpack to achieve hot loading of koa. currently, there is no modification to its own webpack template, which can realize the hot loading of Vue, but the port will ...
set to use token and url, that does not require verification to successfully return to the front end token using login app.js const jwtKoa = require( koa-jwt ); app.use(jwtKoa({secret}).unless({ path: [ adduser , login ] jwt })) but wit...
1. After logging in for the first time, return to the front-end token, and then the front-end takes the token to get the corresponding data 2. When you log in for the second time, you don t need to enter the account password again and jump directly to...
learn node+koa developer is writing a simple example and using token app.use(jwtKoa({secret}).unless({ path: [ ^ adduser , ^ login ] jwt })) when you log in, return to the frontend token and set it to be valid for one hour, but if the token...
Startup file app.js let cookie = { maxAge: new Date().getTime() + 3*24*3600*1000, cookie expires: new Date().getTime() + 3*24*3600*1000, cookie path: , cookie domain: 127.0.0.1 , cookie httpOnly: true, http ...
problem description upload excel files at the front end, and receive and process the files at the back end related codes Please paste the code text below (do not replace the code with pictures) async importMember() { const stream = ...