0.2.0 • Published 2 years ago

@useser/ser v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

SER 🧀

Vercel's serve with proxy support and sensible defaults. Serve your SPA application and add proxy to your staging environment.

MIT License CI SIZE

Features

  • Serving static assets from directory
  • Rewrites urls to index.html
  • Proxy requests to any server with origin change
  • It's fast and easy to setup

Why?

Serve is fantastic and easy to use library for serving static assets of your application. But It's lack of proxy support makes is unuasable in some cases. Ser helps you setup e2e tests server and proxy requests to your testing backend environment.

Installation

Install in project (Recommended)

  npm install @xser/ser --save-dev

or install globally

  npm install @xser/ser -g

Usage

Run using global binary

  ser [directory]

Run using npx

  npx @xser/ser [directory]

Configuration

Proxy using package.json property:

  "ser": {
    "proxy": {
      "/api/(.*)": "http://localhost:5000/$1"
    }
  }

Proxy using CLI:

ser --proxy '{ "/api/(.*)": "http://localhost:5000/$1" }'

FAQ

Is SER 🧀 fully compatibile with serve?

No. Some options are missing. SER is having same core for serving static assets but it's simplified.

What mean SER?

It's short form of ser(ve) as it's easier library for serving static assets. Also it's mean cheese in Polish.

Related

SER 🧀 is HEAVILY inspired by Vercel's Serve.

License

MIT