Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Handling with both Google Cloud Functions and Express
exports.hello = require('./hello');
module.exports = function hello(req, res) {
res.send('Hello');
}
{
"name": "functions-with-express",
"version": "1.0.0",
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Mateusz Haligowski",
"license": "ISC",
"dependencies": {
"express": "^4.15.2"
}
}
var express = require('express');
var app = express();
var hello = require('./hello.js');
app.get('/hello', hello);
app.listen(3000, function() {
console.log('Listening...');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment