Code Monkey home page Code Monkey logo

http-requests-practice's Introduction

HTTP Assignment

Complete the challenges below inside server.js Postman will be a huge help with the assignment - https://www.getpostman.com/

Challenge 1:

When a user does a GET request to "localhost:8000/intro" the server should respond with "Welcome to backend!" in plain text.

Challenge 2:

When a user does a GET request to "localhost:8000/pets" the server should send a json response that is an array of all your pet names (if you don't have any pets make up a few names).

Challenge 3:

When a user does a GET request to "localhost:8000/getinfo" the server should send a text response containing the text within info.txt. HINT - might need to use fs!

STRETCH

Challenge 4:

When a user does a POST request to "localhost:8000/count" you should add to a running total that starts at 0.

Challenge 5:

When a user does a GET request to "localhost:8000/getcount" you should send a text response containing the current running total from challenge 4.

Challenge 6:

When a user does a GET request to "localhost:8000/index" you should send the static index.html file back.

Challenge 7 (very hard!!!!):

When a user does a GET request to "localhost:8000/dynamic" you should respond with the index.html file within the dynamic folder. Replace the {{count}} with the current running count from challenge 4.

http-requests-practice's People

Contributors

zella0 avatar

Watchers

James Cloos 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.