Created
May 6, 2021 11:17
-
-
Save bjerkek/7d366b6ea7b05d293cf4473bbf0e41a7 to your computer and use it in GitHub Desktop.
Learning Podium - Header podlet - 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const Podlet = require('@podium/podlet'); | |
const app = express(); | |
const domain = 'http://localhost'; | |
const port = '7100'; | |
const url = `${domain}:${port}`; | |
const podlet = new Podlet({ | |
name: 'header', | |
version: '1.0.0', | |
pathname: '/', | |
manifest: '/manifest.json', | |
content: '/', | |
fallback: '/fallback', | |
development: true, | |
}); | |
app.use(podlet.middleware()); | |
app.get(podlet.content(), (req, res) => { | |
res.status(200).podiumSend(` | |
<app-header></app-header> | |
`); | |
}); | |
app.get(podlet.manifest(), (req, res) => { | |
res.status(200).send(podlet); | |
}); | |
app.use('/js', express.static('src')); | |
podlet.js({ value: `${url}/js/header.js` }); | |
app.listen(port, () => { | |
console.log(url); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment