![]() ![]() For multi-tenant applications or for network optimizations, you can now limit what data DataStore should sync based on customizable conditions. ![]() Selectively sync your app data based on active functionalityīy default, DataStore downloads the entire contents of your cloud data source to your local device. Play around with the app and add a few songs from your favorite genres. This serves you an app to add new song entries and list them. Test your app on your local machine by running: npm start Replace your App.js file with the following content: import ) In your index.js initialize the Amplify library by adding the following lines of code: import Amplify from 'aws-amplify'Īnfigure(awsconfig) Setup your app’s UI code Run the following command to install the Amplify libraries: npm install aws-amplify Install and initialize the Amplify libraries ![]() Your app backend is successfully deployed! Let’s move on to our client-side code. Run the following command and accept all defaults: amplify push Now that you have your schema set up, let’s deploy your app backend. You have a “Song” model that has a field called “name” a field called “genre”. Run the following command: amplify add apiįor this example, we’ll keep it simple. Let’s add a GraphQL API to sync your app data to the cloud. Initialize an Amplify project by running: amplify initįor the purposes of this blog post, you can just accept all the default values in the amplify init workflow. npx create-react-app songsĬd songs Setup your app backend with Amplify CLI Run the following command to create a new Amplify project called “songs” or if you already have an existing Amplify project skip to the next section. If you haven’t configured the Amplify CLI yet, follow this guide on our documentation page.cURL on Windows: curl -sL -o install.cmd & install.cmd.Using NPM: npm install -g cURL on Linux and Mac: curl -sL | bash & $SHELL.How to enable alphabetical sorting of songs by name.How to ensure to only synchronize the songs downstream of the user’s preferred genre. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |