Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions functions/helloworld/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,3 @@ exports.helloError4 = (req, res) => {
res.status(500).send('I failed you');
// [END functions_helloworld_error]
};

// [START functions_helloworld_template]
const path = require('path');
const pug = require('pug');

// Renders the index.pug
exports.helloTemplate = (req, res) => {
// Render the index.pug file
const html = pug.renderFile(path.join(__dirname, 'index.pug'));

res.send(html).end();
};
// [END functions_helloworld_template]
9 changes: 0 additions & 9 deletions functions/helloworld/index.pug

This file was deleted.

3 changes: 1 addition & 2 deletions functions/helloworld/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
},
"dependencies": {
"@google-cloud/debug-agent": "^5.0.0",
"escape-html": "^1.0.3",
"pug": "^3.0.0"
"escape-html": "^1.0.3"
},
"devDependencies": {
"@google-cloud/functions-framework": "^1.1.1",
Expand Down
22 changes: 0 additions & 22 deletions functions/helloworld/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,26 +156,4 @@ describe('index.test.js', () => {
});
});
});

describe('functions_helloworld_template helloTemplate', () => {
const PORT = 8085;
let ffProc;

before(() => {
ffProc = startFF('helloTemplate', 'http', PORT);
});

after(async () => {
await ffProc;
});

it('helloTemplate: should render the html', async () => {
const response = await httpInvocation('helloTemplate', PORT);

assert.strictEqual(response.statusCode, 200);
assert.ok(
response.body.includes('<h1>Cloud Functions Template Sample</h1>')
);
});
});
});