0

I have created a sample demo site and trying to deploy using serverless deploy on IBM Openwhisk platform. I am getting the following error message and I am unable to figure out what is causing the issue.

Failed to deploy function (myPackage) due to error: PUT https://api.ng.bluemix.net/api/v1/namespaces/_/actions/myPackage?overwrite=true Returned HTTP 500 (Internal Server Error) --> "Response Missing Error Message."

My handler.js code

const serverless = require("serverless-http");
const hbs = require("hbs");
const express = require("express");
const bodyParser = require("body-parser");

const app = express();
app.use(bodyParser.urlencoded({ extended: false }));
// parse application/json
app.use(bodyParser.json());
app.set("view engine", "hbs");

app.get("/", function(req, res) {
  res.status(200).render("index");
});

module.exports.openwhisksauce= serverless(app);

my serverless.yml code :

service: openwhisksauce

provider:
  name: openwhisk
  runtime: nodejs:10.3.0

functions:
  app:
    handler: handler.openwhisksauce
    # The `events` block defines how to trigger the http events
    name: "myPackage"
    events:
        - http: ANY /
        - http: 'ANY {proxy+}'
# remember to run npm install to download the provider plugin.        
plugins:
    - serverless-openwhisk
bhaskar das
  • 175
  • 4
  • 20

1 Answers1

0

There are a number of issues stopping this working.

  • runtime: nodejs:10.3.0 IBM Cloud Functions does not support this runtime. Use nodejs:8.

  • - http: ANY / IBM Cloud Functions API Gateway does not support the ANY method. Replace with valid HTTP verb.

  • https://github.com/dougmoscrop/serverless-http expects to run on AWS Lambda and uses AWS specific runtime and event properties. This will not work on IBM Cloud Functions.

There is a different project to get Express.js apps running on IBM Cloud Functions. See this repo for details...

https://github.com/IBM/expressjs-openwhisk

James Thomas
  • 4,303
  • 1
  • 20
  • 26