Giter Site home page Giter Site logo

week4-challenges's Introduction

Server Promises

  1. clone this repository
  2. optional: run npm install to install all necessary packages (hint: there is currently dependencies installed, so it wont to mucht, but it is always good to just run it after you cloned something)
  3. To start your server, run 'node server.js' (you have to restart it when you make changes to server.js)
  4. Create a new route called '/about' with a new about.html and send it when requesting that route. (Don't forget to also include the stylesheet and the javascript file)
  5. Add links on index.html and about.html to go back and forth between the pages.
  6. Create a utils.js file (next to your server). This file should have a function createRandomWord and export this function.
  7. require that function in the server.js file and make a new route /randomWord to send a random word.
  8. In your client/index.js file, make a axios-get-request (you do not have to install the package, you can just reference axios) to your server and get a random word from your newly created route.
  9. Do that 5 times. You can choose to either chain the promises or use Promise.all to wait for all responses.
  10. When you have those 5 words, create a new <ul> with a <li> containing one of the random words and append it to the index.html. (You may use jQuery here).

week4-challenges's People

Contributors

gisderdube avatar katros 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.