Git Product home page Git Product logo

numberhttpserver's Introduction

Basic HTTP Server for number storage

Author: Carlos Andrés Escalona Contreras

Proposed by: Javier Luna

Main file: NumberHTTPServer.js
Created: 05/05/2021
Updated: 12/05/2021

Installation

git clone

Testing

npm run dev

Description:

  • Server that is listening to requests on port 9000.
Endpoint Method Description
/myNumber GET Displays the number stored in the 'myNumber' variable. If there is no value stored, a 404 error is returned.
/myNumber POST Stores or update the current number in the path /myNumber. If a non-numeric value is sent to create/update 'myNumber', a 400 error is returned.
/reset DELETE Clears the content of the variable 'myNumber'.
/myNumber/{multiplier} GET Returns the stored value multiplied by the value specified in 'multiplier': myNumber*multiplier. If there is no current value for 'myNumber', it returns a 400 error.
  • Node App stores a number in the path /myNumber. Use body payload to send the value: { myNumber: 123 }. Don't create one number per request, just create or update the current number.
  • Any other request is handled with an error code 404, "resource not found".

numberhttpserver's People

Contributors

carland-ec avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.