Skip to content

Commit

Permalink
Merge pull request #45 from kn9ts/develop
Browse files Browse the repository at this point in the history
Add homepage
  • Loading branch information
kn9ts committed Jun 13, 2016
2 parents 55d6eb9 + 6b9a05c commit 400bd00
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.idea
.vscode
node_modules
public
./public
dist
server/config/local.env.js
npm-debug.log
Expand Down
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const genTransactionPassword = require('./server/utils/genTransactionPassword');
const apiVersion = process.env.API_VERSION;

// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('views', path.join(__dirname, 'server/views'));
app.set('view engine', 'jade');

// trust proxy if it's being served in GoogleAppEngine
Expand Down Expand Up @@ -46,6 +46,10 @@ app.use(`/api/v${apiVersion}/payment*`, genTransactionPassword);
const apiRouter = express.Router;
app.use(`/api/v${apiVersion}`, routes(apiRouter()));

app.all('/*', (req, res) => {
res.render('index', { title: 'Project Mulla' });
});

// use this prettify the error stack string into an array of stack traces
const prettifyStackTrace = stackTrace => stackTrace.replace(/\s{2,}/g, ' ').trim();

Expand Down
2 changes: 1 addition & 1 deletion server/controllers/PaymentSuccess.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class PaymentSuccess {
handler(req, res, next) {
const keys = Object.keys(req.body);
const response = {};
const baseURL = `${req.protocol}://${req.hostname}:${process.env.PORT}`;
const baseURL = `${req.protocol}://${req.hostname}:${process.env.PORT || 8080}`;
let endpoint = `${baseURL}/api/v1/thumbs/up`;

if ('MERCHANT_ENDPOINT' in process.env) {
Expand Down
1 change: 1 addition & 0 deletions server/public/css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions server/public/css/style.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@import url(https://fonts.googleapis.com/css?family=Asap:400,700);
@charset "utf-8";
html {
cursor: default;
font-family: 'Asap', sans-serif;
margin: 0;
overflow-x: hidden;
padding: 0;
}

body {
cursor: default;
font-family: 'Asap', sans-serif;
font-size: 1.5em;
margin: 0;
overflow-x: hidden;
padding: 0;
color: #3a3a3a;
background: #fefefe;
}

.homepage {
margin-top: 10%;
text-align: center;
h1 {
font-weight: bolder;
font-size: 4em;
padding-bottom: 0;
margin-bottom: 0;
}
p {
font-size: 2em;
}
footer {
font-size: .25em;
}
.red {
font-weight: bold;
color: red;
}
}
10 changes: 8 additions & 2 deletions server/views/index.jade
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
extends layout

block content
h1= title
p Welcome to #{title}
.homepage
a(style="color: #5FAD24" href="https://kn9ts.github.io/project-mulla" target="_blank")
h1= title
p ...because Time is Money!
footer
p.text-center.text-muted.small-padding
| © 2016, with <span class="red">love</span> by
<a class="red" target="_blank" href="http://twitter.com/kn9ts">Eugene Mutai</a>
2 changes: 1 addition & 1 deletion server/views/layout.jade
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
link(rel='stylesheet', href='/css/style.css')
body
block content

0 comments on commit 400bd00

Please sign in to comment.