O'Reilly logo

Advanced Express Web Application Development by Andrew Keig

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Feature: Create a project

Let's add a project form for our feature Create a project. It consists of a large Add project button, a text box for our project name, and save and cancel buttons. Clicking on save will POST the project to our Express server, whereas, clicking on cancel closes the form.

What follows is an HTML template ./templates/project-form.hbs for a repository item:

<form class="form-inline">
  <ul class="errors help"></ul>
  <label>name</label>
  <input class="name" placeholder="project name" required="required" value="{{name}}" autofocus />
  <br/><button class="cancel btn btn-mini btn-primary form-btn">cancel</button>
  <button class="save btn btn-mini btn-primary form-btn form-spacer">save</button>
</form>

Let's make a few changes to router ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required