Skip to content

Instantly share code, notes, and snippets.

@bjerkek
Last active May 4, 2021 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjerkek/7968c6e57ef7226877ddbaa379159c57 to your computer and use it in GitHub Desktop.
Save bjerkek/7968c6e57ef7226877ddbaa379159c57 to your computer and use it in GitHub Desktop.
Learning Podium - Feedback Podlet - 1
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