Giter VIP home page Giter VIP logo

safe-passage's Introduction

Safe Passage

Express security middleware used by 울집마켓 and Kithub.

Safe Passage NPM Safe Passage Github
Go NPM Go Github
  • Security: Enhance security by setting HTTP headers, managing CORS (Cross-Origin Resource Sharing), preventing CSRF (Cross-Site Request Forgery), and other security-related measures.

  • Error Handling: Implement features to handle unexpected exceptions or errors and provide user-friendly error messages to enhance stability.

  • Request Data Validation: Validate incoming request data and filter out invalid data using middleware to ensure data integrity.

  • Caching: Implement caching to store frequently used data or API responses, optimizing server response time.

  • Rate Limiting: Add functionality to limit the rate of incoming requests to prevent overload and ensure server stability.

  • Session Management: Manage and maintain sessions to track and preserve user states throughout their interactions with the application.

  • Data Compression: Reduce network traffic by compressing response data before sending it to clients.

Usage

import express from 'express';
import SafePassage from 'safe-passage';

const app = express();

app.use(SafePassage({
    header: true,
    error: true,
    valid: true,
    caching: true,
    limit: {
        windowMs: 15 * 60 * 1000,
        max: 1000
    },
    session_key: `testkey`,
    compress: true
}));

app.get(`/`, (req, res) => {
    res.setHeader(`Content-type`, `application/json`);
    res.send(JSON.stringify({}));
});

app.listen(8080, () => {
    console.log(`localhost:8080`);
});

safe-passage's People

Contributors

ice1botmaker avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.