Last active
May 4, 2021 12:17
-
-
Save bjerkek/7968c6e57ef7226877ddbaa379159c57 to your computer and use it in GitHub Desktop.
Learning Podium - Feedback 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 = '7200'; | |
const url = `${domain}:${port}`; | |
const podlet = new Podlet({ | |
name: 'feedback', | |
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 feedback 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