Coder Social home page Coder Social logo

async-lab's Introduction

Purpose

The purpose of this repo is to efficiently use different async techniques in solving the following problem.

Currently the problem is being successfully implemented using node.js callbacks, async.js waterfall and promises and rxjs observables.

More problems will be added soon.

Problem

Create a node server which responds to one and only one route : GET /I/want/title

This route expects a list of websites addresses in query string format e.g.

/I/want/title/?address=google.com
/I/want/title/?address=http://yahoo.com
/I/want/title/?address=google.com&address=www.dawn.com/events/

etc.

The number of addresses can be more than one.

The route will make request to each of the address passed to it. It will parse out the <title></title> tags, render them in html and send back the html in response. e.g. the response to above #3 example would be:

<h1> Following are the titles of given websites: </h1>

<ul>
   <li> google.com - "Google" </li>
   <li> www.dawn.com/events/ - "Events - DAWN.COM" </li>
</ul>
For all other routes, the server should return HTTP code 404 .

Please make sure to add error handling e.g.

/I/want/title/?address=asdasdasd should return

  • asdasdasd - NO RESPONSE
  • async-lab's People

    Contributors

    hhsadiq avatar

    Stargazers

     avatar

    Watchers

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