Skip to content

Instantly share code, notes, and snippets.

@skipluck
Last active April 12, 2018 18:28
Show Gist options
  • Save skipluck/8d2084dc2425cc8350789ca0efd7c4ba to your computer and use it in GitHub Desktop.
Save skipluck/8d2084dc2425cc8350789ca0efd7c4ba to your computer and use it in GitHub Desktop.
Installing Serverless Framework on Ubuntu

Installing Serverless Framework on Ubuntu

Installing Node JS

Node 8.x

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

Node 9.x

curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
sudo apt-get install -y nodejs

Installing Serverless Framework

sudo npm install -g serverless

Configuring AWS Credentials

serverless config credentials --provider aws --key <your-key-here> --secret <your-secret-key-here>

OR

export AWS_ACCESS_KEY_ID=<your-key-here>
export AWS_SECRET_ACCESS_KEY=<your-secret-key-here>

Creating serverless project

Command below will create a Node JS function

serverless create --template aws-nodejs --path my-first-service

Deploying the service

cd my-first-service
serverless deploy

Installing Visual Studio Code (optional but recommended)

Visual Studio Code is a lightweight but powerful source code editor. It comes with built-in support for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other languages (such as C++, C#, Java, Python, PHP, Go)

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo apt-get update
sudo apt-get install code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment