我試圖從an example中學習使用express和firebase上的把手。如何在Firebase雲端函數上使用hapi js?
快車的方式,我們可以直接將「應用」實例的「functions.https.onRequest」像......
const app = express();
...
app.get('/', (req, res) => {
...
});
exports.app = functions.https.onRequest(app);
正如我的理解它的工作,因爲「表達「行爲像http-node,所以它可以迴應」http plain「。
相較於高致病性禽流感,這裏你好世界
const Hapi = require('hapi');
const server = new Hapi.Server();
server.connection({
host: 'localhost',
port: 8000
});
server.route({
method: 'GET',
path:'/hello',
handler: function (request, reply) {
return reply('hello world');
}
});
server.start((err) => {
console.log('Server running at:', server.info.uri);
});
從HAPI例子,是有可能的火力點雲功能使用高致病性禽流感?
我可以在不啓動服務器的情況下使用hapi嗎?
你應該使用hapi或快速消防基地。消防基地Handels路由給你,所以不需要路由框架。保持你的功能重量輕。如果你想渲染車把模板只需要把手。 – philipheinser