Socket
Book a DemoInstallSign in
Socket

@scalar/echo-server

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@scalar/echo-server

an express server which replies with the request data

latest
Source
npmnpm
Version
0.7.2
Version published
Weekly downloads
3
-25%
Maintainers
0
Weekly downloads
 
Created
Source

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": {}
}

Keywords

express

FAQs

Package last updated on 27 Jun 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