Quick Start Guide

Vladimir Porokhov

What is Swifty?

 
Swifty is a serverless platform that allows you to develop and run backend for your web or mobile applications as fast as possible without having to manage any infrastructure. With Swifty, you do not need to think about your application’s scalability or availability, we do it for you. For more convenience, we also include Maria and Mongo databases, Object Storage, and Authentication-as-a-Service. The only thing you need to do is code functions for your backend.

In this quick start guide, we will create a simple “Hello World!” function that uses REST API to answer your request. First, you need to set up access to Swifty. It is available from our own Swifty.Cloud – please create an account here.

Create your first function

 
Please go to “Functions” tab and click “New Function”. Switch to “From repo (Templates)” tab and select default repository “https://github.com/swiftycloud/swifty.demo” if it is not selected by default. You will see templates available from our public repository on GitHub here. You can explore it later to find more functions and demo apps.

Please select “Hello World (golang)” function, click Next, enter the name for your function and click “Create”. Great, you just created your first simple function.

This is really simple function – it gets the “name” argument from the http request and respond with JSON message like {“message: “Hello, ”}.

Next, you need to add Trigger to your function. Trigger could be an endpoint that allows you to request your function using REST API, scheduled action or Object Storage event. More triggers are coming.

To create API trigger please switch to “Triggers” tab, click Add Trigger and select REST API (URL). Next copy and save link to the trigger.

Now you can trigger your API using curl as an example. Go to your console and run the following:

curl -X POST <TRIGGER_URL>?name=Smith

You should get something like:

{"message":"Hello, Smith”}

This is like functions work in Swifty. We have much more features and capabilities here that allows you to build really complex backends and websites. As the next step please review our documentation or learn how to create TODO app with Swifty and Vue.js.

Go serverless!

Share this post

Share on facebook
Share on twitter
Share on email
Share on print