Skip to content

Commit

Permalink
Demonstrate usage of the library in an example app
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldfallen committed Aug 7, 2017
1 parent d70ab47 commit 5901cc4
Show file tree
Hide file tree
Showing 4 changed files with 1,286 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/test-app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const express = require('express');
const lookAndFeel = require('@hmcts/look-and-feel');

const app = express();

lookAndFeel.configure(app, {
express: { views: ['views'] }
});

app.get('/hello-world', (req, res) => {
res.render('HelloWorld');
});

app.listen(3000);
17 changes: 17 additions & 0 deletions examples/test-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "@hmcts/look-and-feel-test-app",
"description": "Example app using look-and-feel",
"version": "0.0.1",
"license": "MIT",
"engines": {
"node": ">=6.0"
},
"scripts": {
"start": "node app.js"
},
"dependencies": {
"express": "^4.15.3",
"@hmcts/look-and-feel": "./../../"
},
"devDependencies": {}
}
7 changes: 7 additions & 0 deletions examples/test-app/views/HelloWorld.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{% extends "govuk_template.html" %}
{% from "patterns/header.njk" import header %}

{% block content -%}
{{ header("Hello World!") }}
Hello World!
{%- endblock %}
Loading

0 comments on commit 5901cc4

Please sign in to comment.