0.6.4 • Published 14 days ago

@scalar/echo-server v0.6.4

Weekly downloads
-
License
MIT
Repository
github
Last release
14 days ago

Scalar Echo Server

Version Downloads License Discord

The Scalar Echo Server is an Express server, which replies with the request data. Works well with the Scalar API Client.

Installation

npm install @scalar/echo-server

Usage

Create a new Node.js project and run the following code to run your own instance:

import { createEchoServer } from '@scalar/echo-server'

const { listen } = createEchoServer()

listen(5052, () => {
  console.log(`🔁 Echo Server listening on http://localhost:5052`)
})

Example

No matter which route you hit, the response contains all the request data and looks like that:

{
  "headers": {
    "host": "localhost:5052",
    "connection": "keep-alive",
    "accept": "*/*",
    "accept-language": "*",
    "sec-fetch-mode": "no-cors",
    "user-agent": "undici",
    "cache-control": "max-age=0",
    "accept-encoding": "gzip, deflate",
    "content-length": "0"
  },
  "cookies": {},
  "method": "GET",
  "path": "/foo",
  "query": {
    "foo": "bar"
  },
  "body": {}
}
0.6.4

14 days ago

0.6.1

1 month ago

0.6.0

2 months ago

0.5.14

2 months ago

0.5.13

3 months ago

0.5.12

3 months ago

0.5.10

3 months ago

0.5.11

3 months ago

0.5.9

3 months ago

0.5.8

4 months ago

0.5.7

4 months ago

0.5.6

5 months ago

0.5.5

6 months ago

0.5.4

6 months ago

0.5.3

7 months ago

0.5.2

7 months ago

0.5.1

8 months ago

0.5.0

8 months ago

0.4.2

8 months ago

0.4.1

8 months ago

0.4.0

8 months ago

0.3.0

9 months ago

0.2.0

9 months ago