Skip to content

Commit

Permalink
Add payment-processor route
Browse files Browse the repository at this point in the history
Add payment-processor hbs file
Add content to default.hbs file
Register inert and vision in server.js
Relates #27 #25 #23
  • Loading branch information
joeylouise committed May 4, 2017
1 parent 68aee6a commit 26d5a70
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/routes/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = [
require('./home'),
require('./payment-processor'),
];
7 changes: 7 additions & 0 deletions src/routes/payment-processor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
method: 'GET',
path: '/payment-processor',
handler: (req, reply) => {
reply.view('payment-processor');
}
}
13 changes: 11 additions & 2 deletions src/server.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
const hapi = require('hapi');
const inert = require('inert');
const vision = require('vision');
const handlebars = require('./handlebars');
const routes = require('./routes');

const server = new hapi.Server();


server.connection({
// host: process.env.HOSTNAME || 'localhost',
port: process.env.PORT || 4000,
});

server.route(routes);
server.register([inert, vision], (err) => {
if (err) {
throw err;
}

server.views(handlebars);
server.route(routes);
});

module.exports = server;
14 changes: 14 additions & 0 deletions src/views/layouts/default.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang='es'>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width" initial-scale="1.0">
<link rel="stylesheet" type="text/css" href="public/css/styles.css">
<link href="https://fonts.googleapis.com/css?family=Pavanam" rel="stylesheet">
<title>FAC donation app</title>
</head>
<body>
<h1>I am the default template heading!</h1>
{{{content}}}
</body>
</html>
1 change: 1 addition & 0 deletions src/views/payment-processor.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>blah blah blah</h1>

0 comments on commit 26d5a70

Please sign in to comment.