Coder Social home page Coder Social logo

spycat-tracker's Introduction

spycat-trackerspycat에서 제공하는 미들웨어 함수입니다.
등록한 서버의 트래픽, 에러 정보를 수집하려면 서버의 소스코드에서 사용하세요.

Installation

npm을 통해 사용할 수 있는 Node.js 모듈입니다.
설치는 npm install 명령어를 사용하세요.

$ npm install spycat-tracker

Usage

trafficParser

const express = require("express");
const { trafficParser } = require("spycat-tracker");

const app = express();

app.use(trafficParser("Your API KEY"));

app.use("/", indexRouter);
app.use("/users", usersRouter);

trafficParser함수는 라우트 분기점보다 위에서 호출하세요.
매개변수로 spycat에서 발급받은 API KEY값을 전달하세요.

errorParser

const express = require("express");
const { errorParser } = require("spycat-tracker");

const app = express();

app.use(errorParser("Your API KEY"));

// error handler
app.use(function (err, req, res, next) {
  res.locals.message = err.message;
  res.locals.error = req.app.get("env") === "development" ? err : {};

  res.status(err.status || 500);
  res.render("error");
});

errorParser함수는 서버의 에러핸들러 바로 위에서 호출하세요.
매개변수로 spycat에서 발급받은 API KEY값을 전달하세요.

spycat-tracker's People

Contributors

gunhwalee avatar

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.