April 2018
Intermediate to advanced
260 pages
6h 31m
English
Setting up a new Node.js project isn't any different from doing so with any other supported language. We'll tell serverless to use the aws-nodejs template and name our project fanout. The -p argument simply tells Serverless to place all of the generated code in the serverless directory, which is relative to the location where we execute this command. Consider the following code:
root@4b26ed909d56:/code# sls create -t aws-nodejs -p serverless -n fanout
Next, we'll add our single dependency for jimp. Here, I'm using yarn, but npm works fine as well:
root@4b26ed909d56:/code/serverless# yarn add jimpyarn add v1.3.2 info No lockfile found. [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... ...
Read now
Unlock full access