Giter VIP home page Giter VIP logo

week-7's Introduction

Week 7

This week is an exercise in sever-side rendering with Express.

Learning Objectives

At the end of this week, a student should:

  • have implemented a simple server-side rendered front end
  • use a database to determine the content of the rendered HTML

The assignment

The assignment this week is designed to get you to build a very simple server-side rendered project. You will build a simple weather app that takes in a location name from a user and then displays a page with the temperature for that location, if available.

Getting started

  1. Make sure you have a recent version of Node.js installed on your computer. I am using Node v12.16, but anything above 12 will be fine.
  2. Ensure you have git and github set up on your computer. If you do not, please follow this guide: https://help.github.com/en/github/getting-started-with-github.
  3. Fork this repository and clone it locally.
  4. In your terminal, from inside this project directory, run npm install to install the project dependencies.
  5. Download and install MongoDB. This project uses the default MongoDB configuration. If you run Mongo in a non-standard way you may need to update the configuration in index.js to match. If you have issues, reference the Mongoose Connection Guide.
  6. Run npm start to start your local server. You should see a logged statement telling you Server is listening on http://localhost:5000.
  7. Download Postman or an API client of your choice. Browse the various endpoints contained in this project. Practice calling all of them and getting 200 HTTP responses.
  8. Run the unit tests of this project: npm test. Your test output should end in something like this:
Test Suites: 1 failed, 1 passed, 2 total
Tests:       8 failed, 52 passed, 60 total

Your Task

We are building a very simple weather application, complete with front end interactions. Here are the routes you will need:

  • Landing
    • Hello World: GET /landing/ - a simple Hello, World page
  • Weather
    • Landing: GET /weather - get a web page that allows you to enter a location name in a form for submission
    • Location: GET /weather/location?name=<location name> - get the temperature for a provided location using a weather mongo collection.

There is a Weather model provided. Please use it to get temperature data. You do not need to create a way to populate this collection, but you may want to create records manually.

Tests for these routes are in place but failing. Your task is to write the additional route, DAO, and model code that will get these tests passing. Doing so will require the use of the mustache library for building HTML from templates.

Once all the provided tests are passing then you should know your code is correct. You should not make any changes to the test files.

Grading

Component Points
All tests, as originally given, are passing 80
Clear, organized project structure 20
Total 100

Submission

  • Create a pull request (PR) from your repository to the main branch of this repository. Make your name the title of the PR.
  • Continuous Integration is handled using Github Actions. This will automatically run your tests and show the results on your PR. If you see a red X and a message saying All checks have failed then you will not receive full credit. Ensure all tests are passing in order to receive full marks.

week-7's People

Contributors

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