Socket
Book a DemoInstallSign in
Socket

@cplabs/shield-server

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cplabs/shield-server

[![Build Status](https://github.com/customer-portal-labs/shield-server/workflows/Build/badge.svg)](https://github.com/customer-portal-labs/shield-server/actions) [![npm version](https://img.shields.io/npm/v/@cplabs/shield-server?logo=npm)](https://www.npm

latest
Source
npmnpm
Version
4.0.0
Version published
Maintainers
1
Created
Source

Shield Server

Build Status npm version shield: project TypeScript code style: prettier codecov License: MIT

Shield Server is a express middlewares bundle, which could help developer to bootstrap a backend project in few minutes.

The features provided by Shield Server

Top features are powered by following popular middlewares:

Getting Started

Installation

npm install @cplabs/shield-server

# or use yarn

yarn add @cplabs/shield-server

Usage

Codeless mode

# Default
shield-server .

Codeless CLI Configuration
  • --port
  • --cors
  • --debug
  • --history-api-fallback
  • --ssl-cert
  • --ssl-key

Middleware mode

const express = require('express');
const {
  defaultMiddlewares,
  defaultErrorHandlers,
  logger,
} = require('@cplabs/shield-server');

const app = express();

app.use(defaultMiddlewares());
app.use(defaultErrorHandlers());

app.listen(8080, () => {
  logger.info(`Server start...`);
});

Configuration

Default configs

https://github.com/customer-portal-labs/shield-server/blob/9394a255a6c7ee206730918e6f7fa1b4d63c0862/src/config.ts#L9-L27

Options

name

type String

The application name

compression

cors

corsOption

mode

  • static
  • api
  • fullstack

morganFormat

  • combined
  • common
  • dev
  • short
  • tiny

port

type int

default 8080

debug

type boolean

default false

ssl

splunk

splunk.httpRequest
splunk.

staticDir

publicPath

proxies

rewrite

historyApiFallback

helmetOption

loggerLevel

requestBodySize

FAQs

Package last updated on 26 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts