Closed pfernandom closed 6 years ago
Doing this would allow any SLS user to do something like:
serverless create --template openfaas-nodejs --path my-service
@alexdebrie PTA
Sorry this got left - I was awaiting input from the Serverless Inc team.
I have actually seen the lib
folder used in other "serverless-*" plugins - are you sure that all the code needs to be in the root of the GitHub repo?
Can you point me to those plugins? To compare them and see if there are extra differences in configuration
Hi @pfernandom I went ahead and implemented your change and have also published to npm
.
Derek close
I have tried to create a new serverless service with the following command
serverless create --template openfaas-nodejs
But I got the following error
Serverless: Loading OpenFaasPackage
Serverless: Generating boilerplate...
Serverless Error ---------------------------------------
Template "openfaas-nodejs" is not supported. Supported templates are: "aws-clojure-gradle", "aws-clojurescript-gradle", "aws-nodejs", "aws-nodejs-typescript", "aws-alexa-typescript", "aws-nodejs-ecma-script", "aws-python", "aws-python3", "aws-groovy-gradle", "aws-java-maven", "aws-java-gradle", "aws-kotlin-jvm-maven", "aws-kotlin-jvm-gradle", "aws-kotlin-nodejs-gradle", "aws-scala-sbt", "aws-csharp", "aws-fsharp", "aws-go", "aws-go-dep", "aws-go-mod", "aws-ruby", "aws-provided", "azure-nodejs", "cloudflare-workers", "cloudflare-workers-enterprise", "cloudflare-workers-rust", "fn-nodejs", "fn-go", "google-nodejs", "google-python", "google-go", "kubeless-python", "kubeless-nodejs", "openwhisk-java-maven", "openwhisk-nodejs", "openwhisk-php", "openwhisk-python", "openwhisk-ruby", "openwhisk-swift", "spotinst-nodejs", "spotinst-python", "spotinst-ruby", "spotinst-java8", "plugin" and "hello-world".
Currently, the SLS plugin code exists in this folder: https://github.com/openfaas/serverless-openfaas/tree/master/lib
We might need to move that code into the repo's root, to follow SLS plugins format.
Look at https://github.com/serverless/serverless-azure-functions for reference.
Once the repo follows that same structure, we can publish it to NPM and make a PR to add a template here https://github.com/serverless/serverless/tree/master/lib/plugins/create/templates/ and have the Serverless team to officially support it.