Closed rochdev closed 7 months ago
Interesting - I am up for it! I also know that the Serverless people are looking at making a generic function handler type interface: (I think the discussion is here: https://github.com/serverless/stdlib-nodejs/issues/14)
So I was thinking I might eventually move to 'that' interface -- thoughts?
how soon will you add support for GCF?
Google Cloud functions look almost like they have their own version of this module anyway "internally" because they give you a req and res object in their handler.
Have you tried just
app = koa() ... app.callback()(req, res)
Without any library help?
yup, it's working.
I'm always up for PRs that can help with any issues around GCF or Azure
Do you have an idea/quick fix to make my function working on Azure? Here is my code:
const express = require('express')
const sls = require('serverless-http')
const app = express()
app.get('/', function (req, res) {
res.send('Hello World!')
})
module.exports.server = sls(app)
I have never looked in to Azure. What does a basic "200 ok" look like in pure azure?
On Wed, Oct 17, 2018, 7:13 PM Emilien Devos notifications@github.com wrote:
Do you have an idea/quick fix to make my function working under Azure? Here is my code:
const express = require('express') const sls = require('serverless-http') const app = express() app.get('/', function (req, res) { res.send('Hello World!') }) module.exports.server = sls(app)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dougmoscrop/serverless-http/issues/6#issuecomment-430821209, or mute the thread https://github.com/notifications/unsubscribe-auth/AAjzFDPaXHZXJJADUpceMS0TYNJHjvHpks5ul7mjgaJpZM4LP9WC .
Here is an example of serverless for Azure: https://github.com/serverless/serverless/blob/master/lib/plugins/create/templates/azure-nodejs/handler.js
And if you need a pure example, here is this code took from the official documentation:
module.exports = async function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
// You can call and await an async method here
return {
body: "Hello, world!"
};
}
Link of the documentation: https://docs.microsoft.com/en-us/azure/azure-functions/functions-reference-node
I refactored this library to support multiple providers, however I don't have any plans to implement them. PRs are welcome.
Where can we find this refactored version? Would there be a branch for this?
I think it would be great as by supporting all providers this project has the potential to become the one serverless framework to rule them all. I don't know if this would fit the current scope of the project though.
Otherwise I am thinking maybe of making another project using this one as its "lambda" adapter.