Giter Site home page Giter Site logo

326-webapis's Introduction

authors team_size goal_id title created_at labels level published redirect_from
tannerwelsh
2
326
Concept Focus: HTTP & Web APIs
2017-04-20T10:00:00Z
concept-focus
2
true
/goals/326

Concept Focus: HTTP & Web APIs

Challenge Rating

This goal will likely be within your ZPD if you...

  • Can choose a goal that fits your ZPD
  • Have set up a web server with Node.js and Express
  • Are familiar with the concept of web servers and clients
  • Are comfortable jumping into a new codebase
  • Are interested in learning more about HTTP
  • Are interested in learning more about how the web works
  • Are interested in working with web APIs

Description

Explore the inner workings of HTTP, and apply your knowledge to interact with an external web API.

Concept focus goals like this one have some unique characteristics. If this is your first time working on one, read the Context for more information.

In working on this goal, you should explore concepts like:

  • The HTTP request-response cycle
  • HTTP verbs
  • URL components: host, path, query string
  • Routing web requests
  • Serving static resources
  • Interacting with an external web API

For guidance and support, start with the Resources provided.

Context

This goal is a concept focus goal, which means that it is not specific about the project you build, but rather the concepts that you apply in building it.

You will have to choose what to build. The details of the project are up to you. The project can be pre-written (so long as you have permission to use it) or a new one of your own choosing. You can even choose projects from other goals.

For inspiration, review the [list of project ideas][project-ideas].

The advantage of this is that you can work on whatever kind of project you like, so long as you focus on building your skills and knowledge of the concept in question.

The disadvantage is that it is very easy to get distracted or to waste time on non-essential tasks like making decisions about project design. It is also likely that you won't have as much support available, since other learners and coaches won't have worked on the same project as you. If you prefer to have more structure and deterministic outcomes, you may not enjoy this goal.

That being said, if you have the self-discipline, motivation, and resolve, you will likely benefit from choosing this goal.

An added benefit of working on a concept-focus goal is that you'll have a project with lots of great examples that you can reference later.

Specifications

General

  • Artifact produced is a GitHub repo.
  • The best resources you find for learning testing are added to a file resources.md.
  • The artifact produced is properly licensed, preferably with the MIT license.

Server

  • GitHub repo contains a web server.
  • Can run the command npm start to start the web server at port 3000.
  • The web server source code is written using the Express library.

Request Types

  • The web server handles routes for GET requests
  • The web server handles routes for POST requests
  • The web server handles routes for PUT/PATCH requests
  • The web server handles routes for DELETE requests
  • Examples of each HTTP verb usage are listed and linked to in the README

Status Codes

The web server makes use of the following response status codes

  • 200 (OK)
  • 201 (Created)
  • 400 (Bad Request)
  • 301 (Moved Permanently)
  • 403 (Forbidden)
  • 404 (Not Found)
  • 500 (Internal Server Error)
  • Examples of each status code usage are listed and linked to in the README

URL Components

The web server uses URL components in routing and responding

  • Different paths trigger different routes
  • Values from the URL query string are used in a route
  • Examples of routing and query string usage are listed and linked to in the README

Headers

The web server makes use of the following request headers

  • Accept
  • Content Type
  • Cookie
  • Examples of each request header usage are listed and linked to in the README

The web server makes use of the following response headers

  • Set-Cookie
  • Refresh
  • Examples of each response header usage are listed and linked to in the README

Resources

The web server serves different types of resources

  • Asset files (CSS, images)
  • Static HTML
  • Static JSON
  • Dynamic resources (content of response changes based on query params, request headers, and/or application state)
  • Examples of each response type are listed and linked to in the README

Example Requests

Example of a raw HTTP request and the server's raw HTTP response are included in the README

  • Examples show full HTTP message header
  • Examples show full HTTP message body

External API

The web server makes the following request types to an external API

  • Get a resource
  • Create a resource
  • Update a resource
  • Delete a resource
  • Examples of each request type to the external API are listed and linked to in the README

Stretch

  • Web server is written using only the core Node.js modules (instead of Express, use the built-in HTTP module)
  • The web server makes use of the Origin request header
  • The web server makes use of the Authorization request header
  • The web server makes use of the Location response header
  • The web server makes use of the Access-Control-Allow-Origin response header
  • The web server makes use of the Content-Length response header
  • Web server uses OAuth to authenticate with the external API
  • OAuth routes are listed and linked to in the README
  • The web server exposes a JSON API at /api
  • API supports all CRUD actions for a resource (Create, Read, Update, Delete)
  • API follows a the RESTful design convention
  • API doesn't use database persistence (an in-memory store is fine)
  • Basic documentation for the API and each route is included in the README

Resources

Courses, Tutorials, Articles

Tools

  • Postman is a nice GUI for building HTTP requests
  • curl is a super useful tool for making HTTP requests from the command line

[project-ideas]: {{ site.url }}{% link project-ideas.md %}

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.