Skip to content

Instantly share code, notes, and snippets.

@jnewman12
Created January 20, 2017 00:38
Show Gist options
  • Select an option

  • Save jnewman12/be2ccaa276acc53accf6c84294aaceaa to your computer and use it in GitHub Desktop.

Select an option

Save jnewman12/be2ccaa276acc53accf6c84294aaceaa to your computer and use it in GitHub Desktop.
EJS lab

Views in Express

Introduction

We've already set you up with an API for capturing your favorite embarrassing quotes – Quotes, Inc. We've thrown in a few styles for you, too, but you might have to mimic some class names and templates. Feel free to delete our style and fancy it up on your own.

Your goal will be to switch an Express JSON API to render views. It's up to you to take it from JSON to EJS, and we haven't given you a lot to start with. It'll help you practice installing the tools you need and setting them up from scratch.

Exercise

  • Use EJS to create views for your RESTful routing as follows:

    • An index page and a page to create new quotes with a form
    • One partial for the footer, head, and header that get rendered on each page
  • Render forms that submit data back to our Express app to make a full-stack app

Deliverable

Do as much as you can – the more complete the better – but the bare minimum you should strive to create is an index & a new page to POST to your create action.

Do your best to make it stylish.

Additional Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment