O'Reilly logo

Node.js 6.x Blueprints by Fernando Monteiro

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

Creating the views template

Now let's create the view file. This file is very important for our application, because that is where we integrate the resources of Swig variables with our JavaScript code:

  1. Create a file called locations.html and save it within the app/views/pages/ folder.
  2. Place the following code inside the locations.html file:
     {% extends 'layout.html' %} {% block content %} <div class="section"> <div class="container"> <br><br> <h1 class="header center teal-text">{{ title }}</h1> <div class="row center"> <h5 class="header col s12 light">Welcome to {{ title }} </h5> </div> <div class="row"> <div class="col s12"> <form action="/nearme" method="POST"> <div class="row"> <div class="col s12" id="map" style="height:600px; width: 100%; margin-bottom: ...

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