Giter Site home page Giter Site logo

express-js-homework's Introduction

General Assembly Logo

Express Weather App

Objectives

  • Build an Express web app that includes a GET and POST request to get the location of our user, and then return data that we will use when learning about API calls to query for the weather in the users location.
  • Use a new NPM package, Weather-JS.
  • Declare/create x1 template for your pages to inherit from, and use in your app.
  • Use best practices when writing code and in organizing your routes.

Getting Started

  • Fork and clone this repository.
  • Make "entry point" for your app (touch app.js).
  • Run npm init to setup our folder.
  • Install your dependencies (Express, EJS, Weather-JS).
  • Create a .gitignore file
  • Run git init to initialize git in folder.
  • Start writing out Express app in app.js.

Requirements/App Map

  • App should include the following routes/views:
    • /: homepage that includes some instructions for the user, and a form that includes a text input and a submit button. The text input should query for a zipcode, and the form should then as a post method send the zipcode to your backend for use. This route should take both GET and POST methods.
    • /weather: a results page that displays the weather in the location given by the user. Display whichever data points from your Weather-JS call that you find relevant/interesting.
    • /weather/:zipcode: a GET route that returns the weather data for whichever zipcode the user passes to route.

Bonuses

  • Write an if statement that passes one template if the weather is "nice" outside, and another if it is not.
  • Write a function that queries a random zipcode for the weather, and returns the /weather/:zipcode route with the result.

Licensing

  1. All content is licensed under a CC-BY-NC-SA 4.0 license.
  2. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact [email protected].

express-js-homework's People

Contributors

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