GithubHelp home page GithubHelp logo

think-meta's Introduction

think-meta

Build Status Coverage Status npm

Show meta for ThinkJS 3.x

Install

npm install think-meta

How to use

config file src/config/middleware.js

const meta = require('think-meta');
module.exports = [
  {
    handle: meta,
    options: {

    }
  }
]

Support options

{
  requestTimeout: 10 * 1000, //request timeout, default is 10s
  requestTimeoutCallback: (ctx, options) => {}, //request timeout callback
  sendPowerBy: true,  //send powerby
  sendResponseTime: true, //send response time
  logRequest: true //log request
}

think-meta's People

Contributors

dyw934854565 avatar lizheming avatar lushijie avatar moshengrenzenme avatar welefen avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

think-meta's Issues

你们有一个merge冲突没解决

index.js下

        if (options.sendResponseTime && !ctx.res.headersSent) {
          ctx.res.setHeader('X-Response-Time', `${endTime - startTime}ms`);
        }
<<<<<<< HEAD
        if(options.logRequest){
          process.nextTick(() => {
            app.think.logger.info(`${ctx.method} ${ctx.url} ${ctx.status} ${endTime - startTime}ms`);
          });
=======
        if (options.logRequest) {
          app.think.logger.info(`${ctx.method} ${ctx.url} ${ctx.status} ${endTime - startTime}ms`);
>>>>>>> 40dc60eb1e6c53c28512952f270e307c0e810605
        }
        if (err) return Promise.reject(err);
      });

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.