🚀 Socket Launch Week Day 4:Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection.Learn more
Sign In

serve-like-a-pro

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serve-like-a-pro

A minimalistic production ready server for static sites

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

Serve Like A Pro

A minimalistic connect based web server for serving static web-sites in a production environment.

Key Features

  • Minimal footprint
  • Can cache specific files in the server memory
  • Can set HTTP cache headers on specific files
  • Automatically recognizes the PORT env var
  • Supports gzip compression

Usage & Setup

Basically install and run the binary

npm install serve-like-a-pro --save
node_modules/.bin/serve-like-a-pro [dirname]

You can start the server programmatically from any other javascript file.

const serve = require('serve-like-a-pro');

const server = serve({
  root: "./build",
  port: process.env.PORT || 1234,
  memoize: ["**/*.js", "**/*.css"],
  cache: {
    "**/*.js": 60 * 60 * 24 * 365
  },
  fallback: "404.html",
  gzip: true
});

All code in this repository is released under the terms of the ISC license

Copyright (C) 2017 Nikolay Nemshilov

FAQs

Package last updated on 26 Jan 2017

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