Last active
May 4, 2021 12:16
-
-
Save bjerkek/1f379d9a416ae8149f9775f993f73bc7 to your computer and use it in GitHub Desktop.
Learning Podium - My loans podlet 1
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 = '7300'; | |
const url = `${domain}:${port}`; | |
const podlet = new Podlet({ | |
name: 'my-loans', | |
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(` | |
<div>This is the my-loans podlet</div> | |
`); | |
}); | |
app.get(podlet.manifest(), (req, res) => { | |
res.status(200).send(podlet); | |
}); | |
app.listen(port, () => { | |
console.log(url); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment