The Database Hub | Back4App
The Database Hub | Back4App
How it works
  • Log In
  • Sign Up

  1. Back4App
  2. Node.js App Template using Cloud Code and Web Hosting
Public

168
124
168
  • DatabaseDatabase
  • GraphQL API PlaygroundAPI Playground
  • Get Started GuideGet Started
  • IssuesIssues
  • ContributorsContributors
  • Database
    Database
    GraphQL API Playground
    API Playground
    Issues
    Issues
    Contributors
    Contributors

  1. Get Started
  2. Flutter
  3. REST
  4. http


Fetch Node.js App Template using Cloud Code and Web Hosting data from your Flutter app

Follow this guide to fetch Node.js App Template using Cloud Code and Web Hosting data from your Flutter app. The http library will be used to fetch the database data through its REST API.

Step 1 - Connect your appStep 2 - Customize your queryStep 3 - Get your code

Step 1 - Connect your app

First you need to connect your app to the Node.js App Template using Cloud Code and Web Hosting database. It will authorize you to access this database API using your app keys. If your app doesn't have keys at Back4App yet, they will be generated during this process.

If your app is already connected to this database, you don't need to do this process again. Just select your app from the list below.

For your convenience, you can also use a fake app (test purposes only) and leave this step to be done later.

Which app do you want to use?

Step 2 - Customize your query

Now let's customize your query to fetch the data that you need!

Which class do you want to fetch data from?

Step 3 - Get your code

Add the http package's latest version to the dependencies section of your pubspec.yaml file:

Install the package from the command line:

If you are building an Android app, make sure that it has internet access permission. Your app's AndroidManifest.xml file should have the following line right after the application section:

Add the following code to your Flutter app:

After running your app, you should see the following output:

Step 1 - Connect your appStep 2 - Customize your queryStep 3 - Get your code