feat(courses): Add Landing Page content modules

This commit is contained in:
Khaled Garbaya
2017-09-26 14:35:53 +02:00
committed by Benedikt Rötsch
parent e2ceb39e83
commit 0c66b6678c
10 changed files with 68 additions and 10 deletions

View File

@@ -1,9 +1,12 @@
const express = require('express')
const {getLandingPage} = require('../services/contentful')
const router = express.Router()
/* GET home page. */
router.get('/', function (req, res, next) {
res.render('index', { title: 'Welcome to Contentful university' })
router.get('/', async function (req, res, next) {
const landingPage = await getLandingPage()
console.log(landingPage.fields.contentModules[1].fields)
res.render('index', { landingPage })
})
module.exports = router