Newbie here, just installed version 1.13 and I’m trying to create the hello world app and I appeared to miss a step. It says to update the’ service’ property, but I can’t locate where it created the hello-world template. It ends up in a loop and I am getting an empty hello-world.zip.
Is it possible when you say creating the hello-world template that you’re referring to the cloudformation-template-create-stack.json file instead? Do I need to create a hello-world.html file and put it in a new directory to which the ‘service’ is pointing? I tried placing it in the serverless directory itself and it was deleted with the app crashing at …\AppData\Roaming\npm\node_modules\serverless\node_modules\glob\sync.js:341
Appreciate any help.
Rick
Hey Rick,
Did you install serverless globally on your machine? npm i serverless -g
Second question, what version of nodejs are you running?
Run node --version
in the terminal to get what version you are currently running
David,
Yes I installed Serverless globally. My current node.js version is 6.9.5
Rick
You will want to create a new folder and run the following command inside of that new folder:
serverless create --template hello-world
That will scaffold how a default API endpoint for you.
Then (from inside that same folder) you can deploy with
serverless deploy
There are no .html
files required.
So from your terminal you can do:
# Make the directory
mkdir my-new-service
# change into the directory
cd my-new-service
# Create serverless hello world
serverless create --template hello-world
# Deploy it
serverless deploy
Make sure you have your AWS credentials setup on your machine. https://www.youtube.com/watch?v=HSd9uYj2LJA
David,
That worked! I was referring to the document here (midway down the page)
Those instructions were missing your first two steps - that’s all I needed.
Rick