Skip to content

Instantly share code, notes, and snippets.

@jcenturion jcenturion/sample.js
Last active Aug 29, 2018

What would you like to do?
'use latest'
import express from 'express';
import { fromExpress } from 'webtask-tools';
import bodyParser from 'body-parser';
const app = express();
app.get('/', (req, res) => {
const HTML = renderView({
title: 'Sample extension',
body: '<h1>Welcome to your extension</h1>'
res.set('Content-Type', 'text/html');
module.exports = fromExpress(app);
function renderView(locals) {
return `
<!DOCTYPE html>
<meta charset="utf-8">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.