Powered By GitBook
run-sailsjs-on-google-app-engine
Learn how to deploy a Sails.js app to App Engine flexible environment.
Contributed by Google employees.
​Sails makes it easy to build custom, enterprise-grade Node.js apps.
You can check out Node.js and Google Cloud to get an overview of Node.js itself and learn ways to run Node.js apps on Google Cloud.

Prerequisites

    1.
    Create a project in the Cloud Console.
    2.
    Enable billing for your project.
    3.
    Install the Cloud SDK.

Prepare

    1.
    Install the Sails.js CLI tool:
    1
    npm install -g sails
    Copied!
    2.
    Create a new Sails.js project (this may take a moment):
    1
    sails new testProject
    Copied!
    3.
    Change directory into the new project:
    1
    cd testProject
    Copied!

Run

    1.
    Run the app with the following command:
    1
    sails lift
    Copied!
    2.
    Visit http://localhost:1337 to see the new project's home page.

Deploy

    1.
    Create an app.yaml file with the following contents:
    1
    runtime: nodejs
    2
    env: flex
    Copied!
    2.
    Run the following command to deploy your app:
    1
    gcloud app deploy
    Copied!
    3.
    Visit http://YOUR_PROJECT_ID.appspot.com to see the Hello World! message.
When the the Sails.js app is deployed it will automatically switch to production mode and listen on the correct port.
Last modified 6mo ago