Skip to content

Instantly share code, notes, and snippets.

@HendrikRoth
Last active May 31, 2016 09:26
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 HendrikRoth/480193d104bdc6590dfb9bb03d2154b9 to your computer and use it in GitHub Desktop.
Save HendrikRoth/480193d104bdc6590dfb9bb03d2154b9 to your computer and use it in GitHub Desktop.
<body>
<h1>Component Test</h1>
<div id="test">Test</div>
<script src="/component.js?id=test&standalone=true"></script>
</body>
module.exports = (req, res) => {
const html = [];
html.push('<script src="node_modules/systemjs/dist/system-csp-production.js"></script>');
html.push('<script>System.config({ defaultJSExtensions: false, paths: { "*": "./node_modules/*", "app/*": "/client/*" } }); System.import("app/index.js"); console.log("hi");</script>');
const code = `document.getElementById('${req.query.id}').innerHTML = '${html.join('')}';`;
res.send(code);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment