sleepy-server

đŸ˜Ē Sleepy Server

https://github.com/ragdata-vault/sleepy-server

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • ✓
    CITATION.cff file
    Found CITATION.cff file
  • ✓
    codemeta.json file
    Found codemeta.json file
  • ✓
    .zenodo.json file
    Found .zenodo.json file
  • ○
    DOI references
  • ○
    Academic publication links
  • ○
    Academic email domains
  • ○
    Institutional organization owner
  • ○
    JOSS paper metadata
  • ○
    Scientific vocabulary similarity
    Low similarity (13.6%) to scientific vocabulary

Keywords

javascript-api javascript-server-example ragdata redeyed-au software-testing-tools
Last synced: 6 months ago · JSON representation ·

Repository

đŸ˜Ē Sleepy Server

Basic Info
  • Host: GitHub
  • Owner: ragdata-vault
  • License: mit
  • Language: JavaScript
  • Default Branch: master
  • Homepage:
  • Size: 19.5 KB
Statistics
  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
javascript-api javascript-server-example ragdata redeyed-au software-testing-tools
Created over 2 years ago · Last pushed over 2 years ago
Metadata Files
Readme License Citation Codeowners

README.md

RagsWorks - Reusable Actions and Workflows [Sleepy Server v-0.1.0](https://github.com/ragdata/sleepy-server/releases/tag/v-0.1.0)

Issues 🔸 Documentation 🔸 Releases

A Sleepy Software Testing Utility

![GitHub issues](https://img.shields.io/github/issues-raw/ragdata/sleepy-server?style=for-the-badge&logo=github) ![Last Commit](https://img.shields.io/github/last-commit/ragdata/sleepy-server/master?logo=github&style=for-the-badge) ![MIT](https://img.shields.io/badge/License-MIT-gold?style=for-the-badge) #### _Elapsed Project Time_ [![wakatime](https://wakatime.com/badge/user/7e04d9d4-3a44-495e-b622-69fdbafd036c/project/eabf6611-5cad-45da-9e23-6de2764dc3a0.svg?style=for-the-badge)](https://wakatime.com/badge/user/7e04d9d4-3a44-495e-b622-69fdbafd036c/project/eabf6611-5cad-45da-9e23-6de2764dc3a0)

If you like this repository, please give it a ⭐ (it really does help) GitHub repository stars

📖 Table of Contents

- [Project Overview](#-project-overview) - [Available Support](#-available-support) - [Installation](#-installation) - [Project Supporters](#-project-supporters) - [Author/Maintainer](#-author--maintainer) - [Security](#-security) - [Copyright & Attributions](#-copyright--attributions) - [License](#-license) - [Resources](#-resources)

⭐ Project Overview

The Sleepy Server is a simple software testing utility. The server will sleep for the period specified in the incoming request before it responds.

The only API method takes a single parameter:

shell http(s)://sleepy.server.org/:sleepValue

Where :sleepValue determines the period that the server will wait before sending a response.

The length of the delay is calculated as the :sleepValue multiplied by the valueMultiplier environment variable (which defaults to 1000 - and as such, we can say that the length of the delay is counted in milliseconds)

Docker Image

Use the 'standard' method to launch the Docker Image from the root directory of the project:

shell docker build -t sleepy:test .

Examples

Example #1

With a :sleepValue of 5 (and the default multiplyer = 1000)

shell $ date; time http http://localhost:3000/5 -b; date Wed Nov 16 09:02:02 CET 2022 Woke up after 5 second(s) of sleep! ... 0.35s user 0.15s system 8% cpu 5.655 total Wed Nov 16 09:02:08 CET 2022

In your terminal window, the scenario might play out like this:

shell $ docker run --rm -p 3000:3000 -d sleepy:test $ docker logs -tf agitated_elemental 2022-11-16T08:00:23.621848495Z Sleeping server listening on port 3000 2022-11-16T08:02:03.494774343Z Going to sleep for 5 second(s)! 2022-11-16T08:02:08.498342553Z Wake up! 5 second(s) passed.

Example #2

Simultaneous Requests:

```shell $ date; for I in $(seq 5 -2 1); do \ ((http GET http://localhost:3000/$I -b | cat - && echo -n ' -- ' && date) &) \ done

Wed Nov 16 09:03:47 CET 2022 Woke up after 1 second(s) of sleep! -- Wed Nov 16 09:03:48 CET 2022 Woke up after 3 second(s) of sleep! -- Wed Nov 16 09:03:50 CET 2022 Woke up after 5 second(s) of sleep! -- Wed Nov 16 09:03:52 CET 2022 ```

And in the server logs:

shell 2022-11-16T08:03:47.917399749Z Going to sleep for 5 second(s)! 2022-11-16T08:03:47.923730533Z Going to sleep for 1 second(s)! 2022-11-16T08:03:47.924537943Z Going to sleep for 3 second(s)! 2022-11-16T08:03:48.925443668Z Wake up! 1 second(s) passed. 2022-11-16T08:03:50.925969532Z Wake up! 3 second(s) passed. 2022-11-16T08:03:52.918711537Z Wake up! 5 second(s) passed.

Configuration (Environment Variables)

  • port - the port on the server will be listening on
  • valueMultiplier - the multiplier of :sleepValue which is used to calculate the length of the delay before the server responds. Leaving this value set to the default of 1000 makes :sleepValue roughly equal to a number of seconds.

đŸ’Ē Available Support

Project Resources:

Community Resources

^ Top

â¤ī¸ Project Supporters

Many Thanks to JetBrains for Their Invaluable Support

JetBrains **JetBrains very generously provide me with a free license for their products every month, and you can get one too if you're working on a public, open-source project!** I've used JetBrains' IDEs for many years now, and was more than happy to pay for a license every year back when I was working in the corporate sector. **Absolutely my first choice in IDEs!**

Click here to find out about available sponsorship opportunities!

If sponsorship isn't right for you, but you have found my work to be useful in some way,
would you please consider buying me a coffee to help keep me going?

Buy Me A Coffee

^ Top

🚧 Author / Maintainer

[![Ragdata](https://img.shields.io/badge/-Darren_"Ragdata"_Poulton-d20000?style=for-the-badge&labelColor=555555&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAgEAYAAACz+d94AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAZAAAAGQBeJH1SwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAnKSURBVFiFtVlrbFTVE/+du7t3a7t3u7vdPhb6pyjFankUiSYWm1gTCsHEWBOpEhEViG9RawXCB1GpNUKaKAFqNFowFkVQxMgj4W2hjRRMlwYQpAil72633W633e7ee8//w3BY+oK2sfPl9JwzZ2Z+M3PmzN6Cc845B8ZrrKkBgOzss2cBoLq6uhoA5s8fb70SxonOnmWMseXLOQeAw4dpNSNDkgBg3z6xP176xw1YIAAAZWUEbNMmsU7zsjKjEQB+/HG89DMRutGS280YYxMnMgYAn35KY1SUpgHAyy/PmsU5552dgv/8ecYYS09PT+ec8/PnxfrFi4wxpiihEABs2UK22Gy6DgBvvUVyrl4dN2CVlYwxdtddFgsAvP8+ra5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6b5n38OXXQGyiN9R46cPOn1NjdTjw/MmUN25ecPBHQbYET0DOzfL6oNRa6wUJI4B778Ujhh2jQypLWVPLxuXUxMbCywYgVVTfGwChJFJj/fYrHbgZUrqfg0NtJ5Ie+mgRLnjJWUkP5PPqHVnTuprB84MJz9g+7YIOQSALzzDgGsqTl+vLOztdXvz8qy2RITjx+vqjKZZDk7u6SEunbRQYyUTp40mcxm4PRpq1WWgQcfpIeZ6OjR8vLOzpaWYJD0z55NsZk+/Y5234mBqs316yT4+efJ6E2bqJktKSHDdH20gAaSOE/yNC02VtfD4c2bSe/GjSR78eKMjMgnhtvRqL9SUW/28cc0i4nJyrLbExNdLpKxaNHtzg71aWBo+v77ioqOjpaW9naS6/XS1RB670yj/q5IVejDD2mWlFRYGAj4fHv30jVvbh6tvAjRa7huXXe3z3fwIAGKiyN9hYWjlTaGD6ZUhf7+GwCWLMnODoWCwczM9HRV7evbsoV4Blep25Om3XuvpoVCX3zx2GPhcDCYmdneDtDXsaGr3p1ozF+CFy7knHNNI4Bvv/3VV11dnZ2aFh3Nua5v3TpSOcRfWrp1q8/X0QFcvAgAb76Znc055yP/HTiI/ut/Bhw6BBiNc+c6HHZ7QkJ5uaLY7YmJnCuK3Z6Q4HaLOe0fP/7HHwDw5JP/tR3j9t+Od981m63W1FSr1WZLSiKACQlut9VqtycmVlYuXaooipKWNl76xw2YGJ1Op9PpdLkUJS7O5dq9Oz4+Pj4+PilpvPX+H9FzAjWyi5ldAAAAAElFTkSuQmCC)](https://github.com/Ragdata) ### [Join me & the RedEyed Community!](https://discord.gg/s6gZZUc67y) Facebook SubStack Dev.to Reddit Twitter [![Discord](https://img.shields.io/discord/1067204348251230298?labelColor=5865F2&label=RedEyed%20Software%20&logo=discord&logoColor=white&style=for-the-badge)](https://discord.gg/s6gZZUc67y)

^ Top

🔐 Security

While I always good security practices, 100% security can never be guaranteed in any software package. The Sleepy Server is provided AS IS, and without warranty. You can find more details in the LICENSE file included with this repository.

If you discover any issue regarding the security of this project, please disclose that information responsibly by sending a security advisory. PLEASE DO NOT CREATE AN ISSUE OR DISCUSSION TOPIC. You can read more about this project's security policies HERE

^ Top

ÂŠī¸ Copyright & Attributions

This project incorporates ideas and / or code crafted by the following talented individuals:

"We see much further, and reach much higher,
only because we stand upon the shoulders of giants"

^ Top

âš–ī¸ License

MIT

Copyright Š 2023 Darren (Ragdata) Poulton

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

^ Top

📖 Resources

^ Top

If you like this repository, please give it a ⭐ (it really does help) GitHub repository stars

Visitors Ragdata

Owner

  • Name: Ragdata's Vault
  • Login: ragdata-vault
  • Kind: organization
  • Email: ragdata@users.noreply.github.com
  • Location: Australia

A holding space for spring cleaning

Citation (CITATION.cff)

# See: https://citation-file-format.github.io/

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0

title: Sleepy Server

message: >-
  If you use this software, please cite using the
  information provided here

type: software

authors:
  - given-names: Darren
    family-names: Poulton
    email: ragdata@ragdata.dev
    orcid: 'https://orcid.org/0000-0001-8986-2886'
    affiliation: Redeyed Software

repository-code: 'https://github.com/ragdata/sleepy-server'

url: 'https://ragdata.github.io/sleepy-server'

abstract: >-
  A testing utility - the sleepy server will sleep for the period it is told to by the incoming request before responding

license: MIT

GitHub Events

Total
Last Year

Dependencies

Dockerfile docker
  • node latest build
package.json npm
  • express ^4.18.2