Scaleway Documentationtutorials
install serverless framework

Update content

Installing the serverless.com framework for Serverless Functions and Containers

Reviewed on 22 December 2021Published on 22 December 2021
  • compute
  • serverless
  • Serverless-Functions
  • Serverless-Containers
Requirements:

The serverless framework is a command line tool, written in Node.js. It allows you to create and mange your Serverless Functions and Serverless Containers resources from the command line.

  1. Check that you have node and npm installed on your local machine:

    $ node -v
    $ npm -v

    Both commands should return the installed version of each tool.

    Note:

    The serverless framework works with Node.js 6.x or later.

  2. Install the serverless framework using npm:

    npm install -g serverless
  3. Check if the installation was sucessful:

    serverless -v 

    The command above returns the version of the serverless framework installed on your computer.

  4. Create a new Python 3 project, called myProject:

    serverless create --template-url https://github.com/scaleway/serverless-scaleway-functions/tree/master/examples/python3 --path myProject
  5. Enter the newly created project:

    cd myProject

    Your project contains the following files:

    • handler.py - Your function code, written in Python3
    • package.json - The list of packages for your function
    • serverless.yml - Your serverless configuration
  6. Install the Serverless Functions plugin in your project:

    serverless plugin install -n serverless-scaleway-functions
  7. Once you have written your function, deploy it using:

    serverless deploy 

For more information about the serverless framework, refer to the official documentation.