From b3af0ffcc0db9cbae085f08592a9ac2293a3d5f8 Mon Sep 17 00:00:00 2001 From: Jacob Logan Date: Thu, 16 May 2024 09:41:43 -0700 Subject: [PATCH 1/2] remove loose pages --- .../graphqlapi/build-a-form-api/index.mdx | 135 --------- .../graphqlapi/graphql-pagination/index.mdx | 127 --------- .../lambda-graphql-resolvers/index.mdx | 257 ------------------ .../restapi/express-server/index.mdx | 149 ---------- .../build-a-backend/restapi/go-api/index.mdx | 152 ----------- .../restapi/nodejs-api/index.mdx | 124 --------- .../restapi/python-api/index.mdx | 131 --------- .../frameworks/deploy-gatsby-site/index.mdx | 33 --- .../frameworks/deploy-gridsome-site/index.mdx | 33 --- .../frameworks/deploy-nextjs-app/index.mdx | 33 --- .../frameworks/deploy-nuxt-site/index.mdx | 33 --- .../frameworks/deploy-vite-site/index.mdx | 33 --- .../deploy-and-host/frameworks/index.mdx | 37 --- .../datastore/parallel-processing/index.mdx | 28 -- .../async-programming-model/index.mdx | 31 --- .../project-setup/combine-framework/index.mdx | 29 -- .../create-application/index.mdx | 72 ----- .../project-setup/escape-hatch/index.mdx | 31 --- .../prev/start/project-setup/index.mdx | 230 ---------------- .../project-setup/kotlin-coroutines/index.mdx | 31 --- .../project-setup/platform-setup/index.mdx | 31 --- .../project-setup/prerequisites/index.mdx | 111 -------- .../prev/start/project-setup/rxjava/index.mdx | 31 --- .../use-existing-resources/index.mdx | 37 --- .../libraries/configure-categories/index.mdx | 51 ---- .../[platform]/prev/tools/libraries/index.mdx | 78 ------ src/pages/gen1/[platform]/reference/index.mdx | 37 --- 27 files changed, 2105 deletions(-) delete mode 100644 src/pages/gen1/[platform]/build-a-backend/graphqlapi/build-a-form-api/index.mdx delete mode 100644 src/pages/gen1/[platform]/build-a-backend/graphqlapi/graphql-pagination/index.mdx delete mode 100644 src/pages/gen1/[platform]/build-a-backend/graphqlapi/lambda-graphql-resolvers/index.mdx delete mode 100644 src/pages/gen1/[platform]/build-a-backend/restapi/express-server/index.mdx delete mode 100644 src/pages/gen1/[platform]/build-a-backend/restapi/go-api/index.mdx delete mode 100644 src/pages/gen1/[platform]/build-a-backend/restapi/nodejs-api/index.mdx delete mode 100644 src/pages/gen1/[platform]/build-a-backend/restapi/python-api/index.mdx delete mode 100644 src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-gatsby-site/index.mdx delete mode 100644 src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-gridsome-site/index.mdx delete mode 100644 src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-nextjs-app/index.mdx delete mode 100644 src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-nuxt-site/index.mdx delete mode 100644 src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-vite-site/index.mdx delete mode 100644 src/pages/gen1/[platform]/deploy-and-host/frameworks/index.mdx delete mode 100644 src/pages/gen1/[platform]/prev/build-a-backend/more-features/datastore/parallel-processing/index.mdx delete mode 100644 src/pages/gen1/[platform]/prev/start/project-setup/async-programming-model/index.mdx delete mode 100644 src/pages/gen1/[platform]/prev/start/project-setup/combine-framework/index.mdx delete mode 100644 src/pages/gen1/[platform]/prev/start/project-setup/create-application/index.mdx delete mode 100644 src/pages/gen1/[platform]/prev/start/project-setup/escape-hatch/index.mdx delete mode 100644 src/pages/gen1/[platform]/prev/start/project-setup/index.mdx delete mode 100644 src/pages/gen1/[platform]/prev/start/project-setup/kotlin-coroutines/index.mdx delete mode 100644 src/pages/gen1/[platform]/prev/start/project-setup/platform-setup/index.mdx delete mode 100644 src/pages/gen1/[platform]/prev/start/project-setup/prerequisites/index.mdx delete mode 100644 src/pages/gen1/[platform]/prev/start/project-setup/rxjava/index.mdx delete mode 100644 src/pages/gen1/[platform]/prev/start/project-setup/use-existing-resources/index.mdx delete mode 100644 src/pages/gen1/[platform]/prev/tools/libraries/configure-categories/index.mdx delete mode 100644 src/pages/gen1/[platform]/prev/tools/libraries/index.mdx delete mode 100644 src/pages/gen1/[platform]/reference/index.mdx diff --git a/src/pages/gen1/[platform]/build-a-backend/graphqlapi/build-a-form-api/index.mdx b/src/pages/gen1/[platform]/build-a-backend/graphqlapi/build-a-form-api/index.mdx deleted file mode 100644 index c8d9ec2c1b6..00000000000 --- a/src/pages/gen1/[platform]/build-a-backend/graphqlapi/build-a-form-api/index.mdx +++ /dev/null @@ -1,135 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Building a Form API with GraphQL', - description: 'How to implement pagination with GraphQL', - platforms: [ - 'javascript', - 'swift', - 'android', - 'angular', - 'nextjs', - 'react', - 'vue' - ] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -In this guide you will learn how to build and interact with a Form API using Amplify. - -The API that you will create is for a basic contact form. The form will allow the user to input their name and phone number, and for us to query for the list of contacts. - -### Getting started - -To get started, create a new Amplify project: - -```sh -amplify init - -# Choose your environment name and default text editor -# You can answer the defaults for the rest of the questions and then choose the AWS profile you'd like to use for this project. -``` - -Next, create a GraphQL API: - -```sh -amplify add api - -? Please select from one of the below mentioned services: - > GraphQL -? Here is the GraphQL API that we will create. Select a setting to edit or continue: - > Name -? Provide API name: - > contactapi -? Here is the GraphQL API that we will create. Select a setting to edit or continue: - > Authorization modes: API key (default, expiration time: 7 days from now) -? Choose the default authorization type for the API: - > API key -? Enter a description for the API key: - > public -? After how many days from now the API key should expire (1-365): - > 365 -? Configure additional auth types? - > No -? Here is the GraphQL API that we will create. Select a setting to edit or continue: - > Continue -? Choose a schema template: - > Single object with fields (e.g., “Todo” with ID, name, description) -? Do you want to edit the schema now? - > Yes -``` - -The CLI should open the GraphQL schema, located at **amplify/backend/api/contactapi/schema.graphql**, in your text editor. Update the schema with the following and save the file: - -```graphql -type Contact @model(mutations: { create: "createContact" }) { - id: ID! - name: String! - phone: String! -} -``` - - - -In the above schema, we've overriding the default mutations and are specifying that only the `createContact` mutation be allowed to be created. By doing this, the API does not allow users to update or delete contacts. For more fine grained authorization rules, check out the [@auth directive](/gen1/[platform]/build-a-backend/graphqlapi/customize-authorization-rules/). - - - -Next, deploy the API: - -```sh -amplify push --y -``` - -### Interacting the API - -To create a new contact, you can use the `createContact` mutation: - -```graphql -mutation createContact { - createContact(input: { name: "Chris", phone: "+1-555-555-5555" }) { - id - name - phone - } -} -``` - -To query for a list of contacts, you can use the `listContacts` query: - -```graphql -query listContacts { - listContacts { - items { - id - name - phone - } - } -} -``` - -import js0 from '/src/fragments/guides/api-graphql/js/building-a-form-api.mdx'; - - diff --git a/src/pages/gen1/[platform]/build-a-backend/graphqlapi/graphql-pagination/index.mdx b/src/pages/gen1/[platform]/build-a-backend/graphqlapi/graphql-pagination/index.mdx deleted file mode 100644 index 9f47a576ca6..00000000000 --- a/src/pages/gen1/[platform]/build-a-backend/graphqlapi/graphql-pagination/index.mdx +++ /dev/null @@ -1,127 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'GraphQL pagination', - description: 'How to implement pagination with GraphQL ', - platforms: [ - 'javascript', - 'react-native', - 'swift', - 'android', - 'angular', - 'nextjs', - 'react', - 'vue' - ] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -In this guide you will learn how to implement pagination in your GraphQL API. - -When working with a large record set, you may want to only fetch the first **N** number of items. For example, let's start with a basic GraphQL schema for a Todo app: - -```graphql -type Todo @model { - id: ID! - title: String! - description: String -} -``` - -When the API is created with an `@model` directive, the following queries will automatically be created for you: - -```graphql -type Query { - getTodo(id: ID!): Todo - listTodos( - filter: ModelTodoFilterInput - limit: Int - nextToken: String - ): ModelTodoConnection -} -``` - -Next, take a look at the `ModelTodoConnection` type to get an idea of the data that will be returned when the `listTodos` query is run: - -```graphql -type ModelTodoConnection { - items: [Todo] - nextToken: String -} -``` - -When querying the API using the `listTodos` query, the return type will be of `ModelTodoConnection`, meaning you can return both an array of `Todos` and a `nextToken`. - -The `nextToken` is what is used to handle pagination. If the `nextToken` is `null`, that means that there is no more data to return from the API. If the `nextToken` is present, you can use the value as an argument to the next `listTodos` query to return the next selection set from the API. - -To test this out, try creating 5 todos using a mutation like this: - -```sh -mutation createTodo { - createTodo(input: { - title: "Todo 1" - description: "My first todo" - }) { - id - title - description - } -} -``` - -Next, you can set the limit of the number of todos in a query by passing in a `limit` argument. In this query, you'll set the limit to 2 items and request a `nextToken` as a return value: - -```graphql -query listTodos { - listTodos(limit: 2) { - items { - id - title - description - } - nextToken - } -} -``` - -Now, to query the next 2 items from the API, you can pass this `nextToken` as the argument: - -```graphql -query listTodos { - listTodos(limit: 2, nextToken: ) { - items { - id - title - description - } - nextToken - } -} -``` - -When there are no other items left to be returned, the `nextToken` in the response will be set to null. - -import js0 from '/src/fragments/guides/api-graphql/js/graphql-pagination.mdx'; - - diff --git a/src/pages/gen1/[platform]/build-a-backend/graphqlapi/lambda-graphql-resolvers/index.mdx b/src/pages/gen1/[platform]/build-a-backend/graphqlapi/lambda-graphql-resolvers/index.mdx deleted file mode 100644 index 91b66b6b814..00000000000 --- a/src/pages/gen1/[platform]/build-a-backend/graphqlapi/lambda-graphql-resolvers/index.mdx +++ /dev/null @@ -1,257 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'How to use Lambda GraphQL Resolvers', - description: - 'How to use Lambda GraphQL resolvers to interact with other services', - platforms: [ - 'javascript', - 'swift', - 'android', - 'angular', - 'nextjs', - 'react', - 'vue' - ] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -The [GraphQL Transform Library](/gen1/[platform]/build-a-backend/graphqlapi/custom-business-logic/#lambda-function-resolver) provides a `@function` directive that enables the configuration of AWS Lambda function resolvers within your GraphQL API. In this guide you will learn how to use Lambda functions as GraphQL resolvers to interact with other services and APIs using the `@function` directive. - -## Creating basic query and mutation Function resolvers - -To get started, let's take a look at a GraphQL schema with a query and a mutation that has the data source set as a Lambda function. - -```graphql -# A query that returns the arguments -type Query { - echo(msg: String): String @function(name: "functionName-${env}") -} - -# A mutation that adds two numbers -type Mutation { - add(number1: Int, number2: Int): Int @function(name: "functionName-${env}") -} -``` - -Using the `@function` directive, you can specify a Lambda function to be invoked as the GraphQL resolver. - -In this guide, you'll learn how to enable Lambda function resolvers in a GraphQL API. - -### Creating the functions - -To get started, create the first Lambda function: - -```sh -amplify add function - -? Provide a friendly name for your resource to be used as a label for this category in the project: echofunction -? Provide the AWS Lambda function name: echofunction -? Choose the function runtime that you want to use: NodeJS -? Choose the function template that you want to use: Hello World -? Do you want to access other resources created in this project from your Lambda function? No -? Do you want to invoke this function on a recurring schedule? No -? Do you want to edit the local lambda function now? Yes -``` - -Open the function code (located at **amplify/backend/function/echofunction/src/index.js**) and press enter: - -```js -exports.handler = async (event) => { - const response = event.arguments.msg; - return response; -}; -``` - -This function will just return the value of the `msg` property passed in as an argument. - -#### Lambda event information - -The `event` object will contain the following properties: - -```js -/* -event = { - "typeName": "Query" or "Mutation", Filled dynamically based on @function usage location - "fieldName": Filled dynamically based on @function usage location - "arguments": { msg }, GraphQL field arguments - "identity": {}, AppSync identity object - "source": {}, The object returned by the parent resolver. E.G. if resolving field 'Post.comments', the source is the Post object - "request": {}, AppSync request object. Contains things like headers - "prev": {} If using the built-in pipeline resolver support, this contains the object returned by the previous function. -} -*/ -``` - -In the above function we've used the `arguments` property to get the values passed in as arguments to the function. - -Next, create another Lambda function: - -```sh -amplify add function - -? Provide a friendly name for your resource to be used as a label for this category in the project: addingfunction -? Provide the AWS Lambda function name: addfunction -? Choose the function runtime that you want to use: NodeJS -? Choose the function template that you want to use: Hello World -? Do you want to access other resources created in this project from your Lambda function? No -? Do you want to invoke this function on a recurring schedule? No -? Do you want to edit the local lambda function now? Yes -``` - -Next, update the function code (located at **amplify/backend/function/addingfunction/src/index.js**) to the following and press enter: - -```js -exports.handler = async (event) => { - /* Add number1 and number2, return the result */ - const response = event.arguments.number1 + event.arguments.number2; - return response; -}; -``` - -This function will add two numbers together and return the result. - -### Creating the GraphQL API - -Now that the functions have been created, you can create the GraphQL API: - -```sh -amplify add api - -? Please select from one of the below mentioned services: - > GraphQL -? Here is the GraphQL API that we will create. Select a setting to edit or continue: - > Name -? Provide API name: - > gqllambda -? Here is the GraphQL API that we will create. Select a setting to edit or continue: - > Authorization modes: API key (default, expiration time: 7 days from now) -? Choose the default authorization type for the API: - > API Key -? Enter a description for the API key: - > public (or some description) -? After how many days from now the API key should expire: - > 365 (or your preferred expiration) -? Configure additional auth types? - > No -? Here is the GraphQL API that we will create. Select a setting to edit or continue: - > Continue -? Choose a schema template: - > Single object with fields (e.g., “Todo” with ID, name, description) -? Do you want to edit the schema now? - > Y -``` - -Next, update the base GraphQL schema (located at **amplify/backend/api/gqllambda/schema.graphql**) with the following code and press enter: - -```graphql -type Query { - echo(msg: String): String @function(name: "echofunction-${env}") -} - -type Mutation { - add(number1: Int, number2: Int): Int @function(name: "addingfunction-${env}") -} -``` - -Now deploy the functions and GraphQL API: - -```sh -amplify push -``` - -### Querying the GraphQL API - -Now, you can run the following queries and mutations to interact with the API: - -```graphql -query echo { - echo(msg: "Hello world!") -} - -mutation add { - add(number1: 1100, number2: 100) -} -``` - -## Creating a resolver that interacts with another API - -Next, you'll create a function that will interact with a public Cryptocurrency REST API. - -Create another function: - -```sh -amplify add function -``` - -Next, update the function code (located at **amplify/backend/function/cryptofunction/src/index.js**) to the following and press enter: - -```javascript -const axios = require('axios'); - -exports.handler = async (event) => { - let limit = 10; - if (event.arguments.limit) { - limit = event.arguments.limit; - } - const url = `https://api.coinlore.net/api/tickers/?limit=${limit}`; - let response = await axios.get(url); - return JSON.stringify(response.data.data); -}; -``` - -Next, install the axios library in the function **src** folder and change back into the root directory: - -```sh -cd amplify/backend/function/cryptofunction/src -npm install axios -cd ../../../../../ -``` - -Now, update the GraphQL schema and add a `getCoins` resolver to the Query type: - -```graphql -type Query { - echo(msg: String): String @function(name: "gqlfunc-${env}") - getCoins(limit: Int): String @function(name: "cryptofunction-${env}") -} -``` - -Next, deploy the updates: - -```sh -amplify push -``` - -Now you can query the GraphQL API using the new `getCoins` query. - -#### Basic query - -```graphql -query getCoins { - getCoins -} -``` - -#### Query with limit - -```graphql -query getCoins { - getCoins(limit: 100) -} -``` - -To learn more about the `@function` directive, check out the GraphQL Transform documentation [here](/gen1/[platform]/build-a-backend/graphqlapi/custom-business-logic/#lambda-function-resolver). diff --git a/src/pages/gen1/[platform]/build-a-backend/restapi/express-server/index.mdx b/src/pages/gen1/[platform]/build-a-backend/restapi/express-server/index.mdx deleted file mode 100644 index f8cd7dec2c1..00000000000 --- a/src/pages/gen1/[platform]/build-a-backend/restapi/express-server/index.mdx +++ /dev/null @@ -1,149 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Deploy an express server', - description: 'How to deploy an Express server to AWS using AWS Amplify', - platforms: [ - 'javascript', - 'swift', - 'android', - 'angular', - 'nextjs', - 'react', - 'vue' - ] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -In this guide you'll learn how to deploy an [Express](https://expressjs.com/) web server complete with routing. - -### Initializing the Amplify project - -Initialize a new Amplify project: - -```sh -amplify init - -# Follow the steps to give the project a name, environment name, and set the default text editor. -# Accept defaults for everything else and choose your AWS Profile. -``` - -### Creating the API and function - -Next, create the API and web server. To do so, you can use the Amplify `add` command: - -```sh -amplify add api - -? Please select from one of the below mentioned services: REST -? Provide a friendly name for your resource to be used as a label for this category in the project: myapi -? Provide a path (e.g., /items): /items (or whatever path you would like) -? Choose a Lambda source: Create a new Lambda function -? Provide a friendly name for your resource to be used as a label for this category in the project: mylambda -? Provide the AWS Lambda function name: mylambda -? Choose the function runtime that you want to use: NodeJS -? Choose the function template that you want to use: Serverless express function -? Do you want to access other resources created in this project from your Lambda function? N -? Do you want to invoke this function on a recurring schedule? N -? Do you want to edit the local lambda function now? N -? Restrict API access: N -? Do you want to add another path? N -``` - -The CLI has created a few things for you: - -- API endpoint -- Lambda function -- Web server using [Serverless Express](https://github.com/awslabs/aws-serverless-express) in the function -- Some boilerplate code for different methods on the `/items` route - -### Updating the function code - -Let's open the code for the server. - -Open **amplify/backend/function/mylambda/src/index.js**. - -In this file you will see the main function handler with the `event` and `context` being proxied to an express server located at `./app.js` (do not make any changes to this file): - -```js -const awsServerlessExpress = require('aws-serverless-express'); -const app = require('./app'); - -const server = awsServerlessExpress.createServer(app); - -exports.handler = (event, context) => { - console.log(`EVENT: ${JSON.stringify(event)}`); - awsServerlessExpress.proxy(server, event, context); -}; -``` - -Next, open **amplify/backend/function/mylambda/src/app.js**. - -Here, you will see the code for the express server and some boilerplate for the different HTTP methods for the route you declared. - -Find the route for `app.get('/items')` and update it to the following: - -```js -// amplify/backend/function/mylambda/src/app.js -app.get('/items', function (req, res) { - const items = ['hello', 'world']; - res.json({ success: 'get call succeed!', items }); -}); -``` - -### Deploying the service - -To deploy the API and function, you can run the `push` command: - -```sh -amplify push -``` - -import js0 from '/src/fragments/guides/api-rest/js/express-api-call.mdx'; - - - -import ios1 from '/src/fragments/guides/api-rest/ios/express-api-call.mdx'; - - - -import android2 from '/src/fragments/guides/api-rest/android/express-api-call.mdx'; - - - -From here, you may want to add additional path. To do so, run the update command: - -```sh -amplify update api -``` - -From there, you can add, update, or remove paths. To learn more about interacting with REST APIs using Amplify, check out the complete documentation [here](/gen1/[platform]/build-a-backend/restapi/set-up-rest-api/). - -The API endpoint is located in the `aws-exports.js` folder. - -You can also interact directly with the API using this URL and the specified path: - -```sh -curl https://.execute-api..amazonaws.com//items -``` diff --git a/src/pages/gen1/[platform]/build-a-backend/restapi/go-api/index.mdx b/src/pages/gen1/[platform]/build-a-backend/restapi/go-api/index.mdx deleted file mode 100644 index 4bda171e3c3..00000000000 --- a/src/pages/gen1/[platform]/build-a-backend/restapi/go-api/index.mdx +++ /dev/null @@ -1,152 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Deploy Go API', - description: 'How to deploy a Go API using Amplify Functions', - platforms: [ - 'javascript', - 'swift', - 'android', - 'angular', - 'nextjs', - 'react', - 'vue' - ] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -In this guide, you will learn how to deploy a Go API. - -## 1. Initialize a new Amplify project - -```sh -amplify init - -# Follow the steps to give the project a name, environment name, and set the default text editor. -# Accept defaults for everything else and choose your AWS Profile. -``` - -## 2. Add the API and function - -```sh -amplify add api - -? Please select from one of the below mentioned services: REST -? Provide a friendly name for your resource to be used as a label for this category in the project: goapi -? Provide a path (e.g., /book/{isbn}): /hello -? Choose a Lambda source: Create a new Lambda function -? Provide a friendly name for your resource to be used as a label for this category in the project: greetingfunction -? Provide the AWS Lambda function name: greetingfunction -? Choose the function runtime that you want to use: Go -? Do you want to access other resources created in this project from your Lambda function? N -? Do you want to invoke this function on a recurring schedule? N -? Do you want to edit the local lambda function now? N -? Restrict API access: N -? Do you want to add another path? N -``` - -The CLI should have created a new function located at **amplify/backend/function/greetingfunction**. - -## 3. Updating the function code - -Next, open **amplify/backend/function/greetingfunction/src/main.go** and update the code to the following: - -```go -package main - -import ( - "bytes" - "context" - "encoding/json" - "github.com/aws/aws-lambda-go/events" - "github.com/aws/aws-lambda-go/lambda" -) - -type Response events.APIGatewayProxyResponse - -func Handler(ctx context.Context) (Response, error) { - var buf bytes.Buffer - - body, err := json.Marshal(map[string]interface{}{ - "message": "Congrats! Your function executed successfully!", - }) - if err != nil { - return Response{StatusCode: 404}, err - } - json.HTMLEscape(&buf, body) - - resp := Response{ - StatusCode: 200, - IsBase64Encoded: false, - Body: buf.String(), - Headers: map[string]string{ - "Content-Type": "application/json", - "X-MyCompany-Func-Reply": "hello-handler", - "Access-Control-Allow-Origin": "*", - "Access-Control-Allow-Methods": "POST, GET, OPTIONS, PUT, DELETE", - "Access-Control-Allow-Headers": "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization", - }, - } - - return resp, nil -} - -func main() { - lambda.Start(Handler) -} -``` - -## 4. Deploy the API - -To deploy the API, run the `push` command: - -```sh -amplify push -``` - -## 5. Using the API - -Here is how you can send a GET request to the API. - -import js0 from '/src/fragments/guides/api-rest/js/go-api-call.mdx'; - - - -import ios1 from '/src/fragments/guides/api-rest/ios/rest-api-call.mdx'; - - - -import android2 from '/src/fragments/guides/api-rest/android/rest-api-call.mdx'; - - - -To learn more about interacting with REST APIs using Amplify, check out the complete documentation [here](/gen1/[platform]/build-a-backend/restapi/set-up-rest-api/). - -The API endpoint is located in the `aws-exports.js` folder. - -You can also interact directly with the API using this URL and the specified path: - -```sh -curl https://.execute-api..amazonaws.com//hello -``` diff --git a/src/pages/gen1/[platform]/build-a-backend/restapi/nodejs-api/index.mdx b/src/pages/gen1/[platform]/build-a-backend/restapi/nodejs-api/index.mdx deleted file mode 100644 index 62ff104257c..00000000000 --- a/src/pages/gen1/[platform]/build-a-backend/restapi/nodejs-api/index.mdx +++ /dev/null @@ -1,124 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Deploy a Node.js API', - description: 'How to deploy a NodeJS API using Amplify Functions', - platforms: [ - 'javascript', - 'swift', - 'android', - 'angular', - 'nextjs', - 'react', - 'vue' - ] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -In this guide, you will learn how to deploy a Node.js API. - -## 1. Initialize a new Amplify project - -```sh -amplify init - -# Follow the steps to give the project a name, environment name, and set the default text editor. -# Accept defaults for everything else and choose your AWS Profile. -``` - -## 2. Add the API and function - -```sh -amplify add api - -? Please select from one of the below mentioned services: REST -? Provide a friendly name for your resource to be used as a label for this category in the project: nodeapi -? Provide a path (e.g., /book/{isbn}): /hello -? Choose a Lambda source: Create a new Lambda function -? Provide a friendly name for your resource to be used as a label for this category in the project: greetingfunction -? Provide the AWS Lambda function name: greetingfunction -? Choose the function runtime that you want to use: NodeJS -? Choose the function template that you want to use: Hello World -? Do you want to access other resources created in this project from your Lambda function? N -? Do you want to invoke this function on a recurring schedule? N -? Do you want to edit the local lambda function now? N -? Restrict API access: N -? Do you want to add another path? N -``` - -The CLI should have created a new function located at **amplify/backend/function/greetingfunction**. - -## 3. Updating the function code - -Next, open **amplify/backend/function/greetingfunction/src/index.js** and update the code to the following: - -```js -exports.handler = async (event) => { - const body = { - message: 'Hello from Lambda' - }; - const response = { - statusCode: 200, - body: JSON.stringify(body), - headers: { - 'Access-Control-Allow-Origin': '*' - } - }; - return response; -}; -``` - -## 4. Deploy the API - -To deploy the API, run the `push` command: - -```sh -amplify push -``` - -## 5. Using the API - -Here is how you can send a GET request to the API. - -import js0 from '/src/fragments/guides/api-rest/js/rest-api-call.mdx'; - - - -import ios1 from '/src/fragments/guides/api-rest/ios/rest-api-call.mdx'; - - - -import android2 from '/src/fragments/guides/api-rest/android/rest-api-call.mdx'; - - - -To learn more about interacting with REST APIs using Amplify, check out the complete documentation [here](/gen1/[platform]/build-a-backend/restapi/set-up-rest-api/). - -The API endpoint is located in the `aws-exports.js` folder. - -You can also interact directly with the API using this URL and the specified path: - -```sh -curl https://.execute-api..amazonaws.com//hello -``` diff --git a/src/pages/gen1/[platform]/build-a-backend/restapi/python-api/index.mdx b/src/pages/gen1/[platform]/build-a-backend/restapi/python-api/index.mdx deleted file mode 100644 index 7aa49677d91..00000000000 --- a/src/pages/gen1/[platform]/build-a-backend/restapi/python-api/index.mdx +++ /dev/null @@ -1,131 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Deploy Python API', - description: 'How to deploy a Python API using Amplify Functions', - platforms: [ - 'javascript', - 'swift', - 'android', - 'angular', - 'nextjs', - 'react', - 'vue' - ] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -In this guide, you will learn how to deploy a Python API. - -## 1. Initialize a new Amplify project - -```sh -amplify init - -# Follow the steps to give the project a name, environment name, and set the default text editor. -# Accept defaults for everything else and choose your AWS Profile. -``` - -## 2. Add the API and function - -```sh -amplify add api - -? Please select from one of the below mentioned services: REST -? Provide a friendly name for your resource to be used as a label for this category in the project: pythonapi -? Provide a path (e.g., /book/{isbn}): /hello -? Choose a Lambda source: Create a new Lambda function -? Provide a friendly name for your resource to be used as a label for this category in the project: greetingfunction -? Provide the AWS Lambda function name: greetingfunction -? Choose the function runtime that you want to use: Python -? Do you want to access other resources created in this project from your Lambda function? N -? Do you want to invoke this function on a recurring schedule? N -? Do you want to edit the local lambda function now? N -? Restrict API access: N -? Do you want to add another path? N -``` - -The CLI should have created a new function located at **amplify/backend/function/greetingfunction**. - -## 3. Updating the function code - -Next, open **amplify/backend/function/greetingfunction/src/index.py** and update the code to the following: - -```python -import json -import datetime - -def handler(event, context): - - current_time = datetime.datetime.now().time() - - body = { - 'message': 'Hello, the current time is ' + str(current_time) - } - - response = { - 'statusCode': 200, - 'body': json.dumps(body), - 'headers': { - 'Content-Type': 'application/json', - 'Access-Control-Allow-Origin': '*' - }, - } - - return response -``` - -## 4. Deploy the API - -To deploy the API, run the `push` command: - -```sh -amplify push -``` - -## 5. Using the API - -Here is how you can send a GET request to the API. - -import js0 from '/src/fragments/guides/api-rest/js/python-api-call.mdx'; - - - -import ios1 from '/src/fragments/guides/api-rest/ios/rest-api-call.mdx'; - - - -import android2 from '/src/fragments/guides/api-rest/android/rest-api-call.mdx'; - - - -To learn more about interacting with REST APIs using Amplify, check out the complete documentation [here](/gen1/[platform]/build-a-backend/restapi/set-up-rest-api/). - -The API endpoint is located in the `aws-exports.js` folder. - -You can also interact directly with the API using this URL and the specified path: - -```sh -curl https://.execute-api..amazonaws.com//hello -``` diff --git a/src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-gatsby-site/index.mdx b/src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-gatsby-site/index.mdx deleted file mode 100644 index 18c0d6779bf..00000000000 --- a/src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-gatsby-site/index.mdx +++ /dev/null @@ -1,33 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Deploy a Gatsby site', - description: 'How to deploy a Gatsby site to Amplify Console Hosting', - platforms: ['javascript', 'angular', 'nextjs', 'react', 'vue'] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -import js0 from '/src/fragments/guides/hosting/gatsby.mdx'; - - diff --git a/src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-gridsome-site/index.mdx b/src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-gridsome-site/index.mdx deleted file mode 100644 index 2a0dc1d16af..00000000000 --- a/src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-gridsome-site/index.mdx +++ /dev/null @@ -1,33 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Deploy a Gridsome site', - description: 'How to deploy a Gridsome site to Amplify Console Hosting', - platforms: ['javascript', 'angular', 'nextjs', 'react', 'vue'] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -import js0 from '/src/fragments/guides/hosting/gridsome.mdx'; - - diff --git a/src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-nextjs-app/index.mdx b/src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-nextjs-app/index.mdx deleted file mode 100644 index 8fd5587456d..00000000000 --- a/src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-nextjs-app/index.mdx +++ /dev/null @@ -1,33 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Deploy a Next.js app', - description: 'How to deploy a Next.js site to Amplify Hosting', - platforms: ['javascript', 'angular', 'nextjs', 'react', 'vue'] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -import js0 from '/src/fragments/guides/hosting/nextjs.mdx'; - - diff --git a/src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-nuxt-site/index.mdx b/src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-nuxt-site/index.mdx deleted file mode 100644 index 1724ca344e6..00000000000 --- a/src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-nuxt-site/index.mdx +++ /dev/null @@ -1,33 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Deploy a Nuxt site', - description: 'How to deploy a Nuxt site to Amplify Console Hosting', - platforms: ['javascript', 'angular', 'nextjs', 'react', 'vue'] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -import js0 from '/src/fragments/guides/hosting/nuxt.mdx'; - - diff --git a/src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-vite-site/index.mdx b/src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-vite-site/index.mdx deleted file mode 100644 index cefe395d8a7..00000000000 --- a/src/pages/gen1/[platform]/deploy-and-host/frameworks/deploy-vite-site/index.mdx +++ /dev/null @@ -1,33 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Deploy a Vite site', - description: 'How to deploy a Vite site to Amplify Hosting', - platforms: ['javascript', 'angular', 'nextjs', 'react', 'vue'] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -import js0 from '/src/fragments/guides/hosting/vite.mdx'; - - diff --git a/src/pages/gen1/[platform]/deploy-and-host/frameworks/index.mdx b/src/pages/gen1/[platform]/deploy-and-host/frameworks/index.mdx deleted file mode 100644 index 09a3f3da855..00000000000 --- a/src/pages/gen1/[platform]/deploy-and-host/frameworks/index.mdx +++ /dev/null @@ -1,37 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; -import { getChildPageNodes } from '@/utils/getChildPageNodes'; - -export const meta = { - title: 'Frameworks', - description: 'Frameworks', - platforms: [ - 'android', - 'angular', - 'flutter', - 'javascript', - 'nextjs', - 'react', - 'react-native', - 'swift', - 'vue' - ], - route: '/gen1/[platform]/deploy-and-host/frameworks' -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - const childPageNodes = getChildPageNodes(meta.route); - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta, - childPageNodes - } - }; -} - - diff --git a/src/pages/gen1/[platform]/prev/build-a-backend/more-features/datastore/parallel-processing/index.mdx b/src/pages/gen1/[platform]/prev/build-a-backend/more-features/datastore/parallel-processing/index.mdx deleted file mode 100644 index 46c68b1014c..00000000000 --- a/src/pages/gen1/[platform]/prev/build-a-backend/more-features/datastore/parallel-processing/index.mdx +++ /dev/null @@ -1,28 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Parallel processing', - description: - 'How to multiple DataStore operations in parallel.', - platforms: [ - 'swift' - ] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -import ios0 from '/src/fragments/guides/datastore/parallel-processing-ios.mdx'; - - diff --git a/src/pages/gen1/[platform]/prev/start/project-setup/async-programming-model/index.mdx b/src/pages/gen1/[platform]/prev/start/project-setup/async-programming-model/index.mdx deleted file mode 100644 index 9f01cb6a02c..00000000000 --- a/src/pages/gen1/[platform]/prev/start/project-setup/async-programming-model/index.mdx +++ /dev/null @@ -1,31 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Async Programming Model', - description: 'Amplify Android uses an asynchronous programming model', - platforms: ['android'] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - - - -import android_maintenance from '/src/fragments/lib-v1/android-maintenance.mdx'; - - - -import android0 from '/src/fragments/lib-v1/project-setup/android/async/async.mdx'; - - diff --git a/src/pages/gen1/[platform]/prev/start/project-setup/combine-framework/index.mdx b/src/pages/gen1/[platform]/prev/start/project-setup/combine-framework/index.mdx deleted file mode 100644 index 46409307c7b..00000000000 --- a/src/pages/gen1/[platform]/prev/start/project-setup/combine-framework/index.mdx +++ /dev/null @@ -1,29 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Using the Combine framework with Amplify', - description: "Amplify's support for Apple's Combine framework", - platforms: ['swift'] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -import ios_maintenance from '/src/fragments/lib-v1/ios-maintenance.mdx'; - - - -import ios0 from '/src/fragments/lib-v1/project-setup/ios/combine/combine.mdx'; - - diff --git a/src/pages/gen1/[platform]/prev/start/project-setup/create-application/index.mdx b/src/pages/gen1/[platform]/prev/start/project-setup/create-application/index.mdx deleted file mode 100644 index 9fc9df250ee..00000000000 --- a/src/pages/gen1/[platform]/prev/start/project-setup/create-application/index.mdx +++ /dev/null @@ -1,72 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Amplify project setup', - description: - 'Set up Amplify prerequisites and a project.', - platforms: [ - 'angular', - 'javascript', - 'nextjs', - 'react', - 'vue', - 'swift', - 'android', - 'flutter', - 'react-native' - ] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -import ios_maintenance from '/src/fragments/lib-v1/ios-maintenance.mdx'; - - - -import flutter_maintenance from '/src/fragments/lib-v1/flutter-maintenance.mdx'; - - - -import ios0 from '/src/fragments/lib-v1/project-setup/native_common/create-application/common.mdx'; - - - -import android_maintenance from '/src/fragments/lib-v1/android-maintenance.mdx'; - - - -import android1 from '/src/fragments/lib-v1/project-setup/native_common/create-application/common.mdx'; - - - -import flutter2 from '/src/fragments/lib-v1/project-setup/native_common/create-application/common.mdx'; - - - -import react_native2 from '/src/fragments/start/getting-started/reactnative/setup.mdx'; - - - -import js0 from '/src/fragments/lib-v1/project-setup/js/getting-started.mdx'; - - diff --git a/src/pages/gen1/[platform]/prev/start/project-setup/escape-hatch/index.mdx b/src/pages/gen1/[platform]/prev/start/project-setup/escape-hatch/index.mdx deleted file mode 100644 index b577c4efed9..00000000000 --- a/src/pages/gen1/[platform]/prev/start/project-setup/escape-hatch/index.mdx +++ /dev/null @@ -1,31 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Escape hatch', - description: 'Advanced use cases in Amplify Flutter', - platforms: ['flutter'] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - - - -import flutter_maintenance from '/src/fragments/lib-v1/flutter-maintenance.mdx'; - - - -import flutter from '/src/fragments/lib-v1/project-setup/flutter/escape-hatch/escape-hatch.mdx'; - - diff --git a/src/pages/gen1/[platform]/prev/start/project-setup/index.mdx b/src/pages/gen1/[platform]/prev/start/project-setup/index.mdx deleted file mode 100644 index c94953db91c..00000000000 --- a/src/pages/gen1/[platform]/prev/start/project-setup/index.mdx +++ /dev/null @@ -1,230 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Amplify project setup', - description: - 'Set up Amplify prerequisites and a project.', - platforms: [ - 'angular', - 'javascript', - 'nextjs', - 'react', - 'vue', - 'swift', - 'android', - 'flutter', - 'react-native' - ] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - - - -We recommend that you use the [latest version for project setup](/gen1/[platform]/start/project-setup/) for your chosen framework or language. - -This page is a reference for those who need the previous version and includes all project setup content for that version. Selecting the navigation menu will take you back to the current version by default. - - - -import ios_maintenance from '/src/fragments/lib-v1/ios-maintenance.mdx'; - - - -import ios0 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_header.mdx'; - - - -import android_maintenance from '/src/fragments/lib-v1/android-maintenance.mdx'; - - - -import flutter_maintenance from '/src/fragments/lib-v1/flutter-maintenance.mdx'; - - - -import android0 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_header.mdx'; - - - -import reactnative0 from '/src/fragments/lib/project-setup/native_common/prereq/common_header.mdx'; - - - -import js0 from '/src/fragments/lib/project-setup/native_common/prereq/common_header.mdx'; - - - -import ios1 from '/src/fragments/lib-v1/project-setup/ios/prereq/prereq.mdx'; - - - -import android1 from '/src/fragments/lib-v1/project-setup/android/prereq/prereq.mdx'; - - - -import ios2 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_body.mdx'; - - - -import android2 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_body.mdx'; - - - -import flutter0 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_header.mdx'; - - - -import flutter1 from '/src/fragments/lib-v1/project-setup/flutter/prereq/prereq.mdx'; - - - -import flutter2 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_body.mdx'; - - - -import js1 from '/src/fragments/lib/project-setup/native_common/prereq/common_body.mdx'; - - - -import reactnative1 from '/src/fragments/lib/project-setup/native_common/prereq/common_body.mdx'; - - - -## Create your application - -import ios3 from '/src/fragments/lib-v1/project-setup/native_common/create-application/common.mdx'; - - - -import android3 from '/src/fragments/lib-v1/project-setup/native_common/create-application/common.mdx'; - - - -import flutter3 from '/src/fragments/lib-v1/project-setup/native_common/create-application/common.mdx'; - - - -import react_native2 from '/src/fragments/start/getting-started/reactnative/setup.mdx'; - - - -import js2 from '/src/fragments/lib-v1/project-setup/js/getting-started.mdx'; - - - - - -## Further customization - - - - - -## Async Programming Model - -import android4 from '/src/fragments/lib-v1/project-setup/android/async/async.mdx'; - - - - - - - -## Kotlin Coroutines support - -import android5 from '/src/fragments/lib-v1/project-setup/android/coroutines/coroutines.mdx'; - - - - - - - -## Using RxJava with Amplify - -import android6 from '/src/fragments/lib-v1/project-setup/android/rxjava/rxjava.mdx'; - - - - - - - -## Platform setup - -import flutter4 from '/src/fragments/lib-v1/project-setup/flutter/platform-setup/platform-setup.mdx'; - - - - - - - -## Escape hatch - -import flutter5 from '/src/fragments/lib-v1/project-setup/flutter/escape-hatch/escape-hatch.mdx'; - - - - - - - -## Use the Combine framework with Amplify - -import ios4 from '/src/fragments/lib-v1/project-setup/ios/combine/combine.mdx'; - - - - - - - -## Use existing AWS resources - -import ios5 from '/src/fragments/lib-v1/project-setup/ios/use-existing-resources/use-existing-resources.mdx'; - - - -import android7 from '/src/fragments/lib-v1/project-setup/android/use-existing-resources/use-existing-resources.mdx'; - - - - diff --git a/src/pages/gen1/[platform]/prev/start/project-setup/kotlin-coroutines/index.mdx b/src/pages/gen1/[platform]/prev/start/project-setup/kotlin-coroutines/index.mdx deleted file mode 100644 index c26cc7b98e5..00000000000 --- a/src/pages/gen1/[platform]/prev/start/project-setup/kotlin-coroutines/index.mdx +++ /dev/null @@ -1,31 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Kotlin Coroutines support', - description: 'Amplify Android includes first-class support for Kotlin Coroutines and Flows.', - platforms: ['android'] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - - - -import android_maintenance from '/src/fragments/lib-v1/android-maintenance.mdx'; - - - -import android0 from '/src/fragments/lib-v1/project-setup/android/coroutines/coroutines.mdx'; - - diff --git a/src/pages/gen1/[platform]/prev/start/project-setup/platform-setup/index.mdx b/src/pages/gen1/[platform]/prev/start/project-setup/platform-setup/index.mdx deleted file mode 100644 index 908212df181..00000000000 --- a/src/pages/gen1/[platform]/prev/start/project-setup/platform-setup/index.mdx +++ /dev/null @@ -1,31 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Platform setup', - description: 'Instructions for platform-specific configurations needed for amplify-flutter', - platforms: ['flutter'] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - - - -import flutter_maintenance from '/src/fragments/lib-v1/flutter-maintenance.mdx'; - - - -import flutter0 from '/src/fragments/lib-v1/project-setup/flutter/platform-setup/platform-setup.mdx'; - - diff --git a/src/pages/gen1/[platform]/prev/start/project-setup/prerequisites/index.mdx b/src/pages/gen1/[platform]/prev/start/project-setup/prerequisites/index.mdx deleted file mode 100644 index eb8a3ee9080..00000000000 --- a/src/pages/gen1/[platform]/prev/start/project-setup/prerequisites/index.mdx +++ /dev/null @@ -1,111 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Set up Amplify prerequisites', - description: 'Project setup with Amplify - Prerequisites', - platforms: [ - 'javascript', - 'swift', - 'android', - 'flutter', - 'react-native', - 'angular', - 'nextjs', - 'react', - 'vue' - ] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -import ios_maintenance from '/src/fragments/lib-v1/ios-maintenance.mdx'; - - - -import ios0 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_header.mdx'; - - - -import android_maintenance from '/src/fragments/lib-v1/android-maintenance.mdx'; - - - -import flutter_maintenance from '/src/fragments/lib-v1/flutter-maintenance.mdx'; - - - -import android1 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_header.mdx'; - - - -import reactnative0 from '/src/fragments/lib/project-setup/native_common/prereq/common_header.mdx'; - - - -import js0 from '/src/fragments/lib/project-setup/native_common/prereq/common_header.mdx'; - - - -import ios3 from '/src/fragments/lib-v1/project-setup/ios/prereq/prereq.mdx'; - - - -import android4 from '/src/fragments/lib-v1/project-setup/android/prereq/prereq.mdx'; - - - -import ios6 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_body.mdx'; - - - -import android7 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_body.mdx'; - - - -import flutter2 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_header.mdx'; - - - -import flutter5 from '/src/fragments/lib-v1/project-setup/flutter/prereq/prereq.mdx'; - - - -import flutter8 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_body.mdx'; - - - -import js1 from '/src/fragments/lib/project-setup/native_common/prereq/common_body.mdx'; - - - -import reactnative1 from '/src/fragments/lib/project-setup/native_common/prereq/common_body.mdx'; - - diff --git a/src/pages/gen1/[platform]/prev/start/project-setup/rxjava/index.mdx b/src/pages/gen1/[platform]/prev/start/project-setup/rxjava/index.mdx deleted file mode 100644 index b841011fc25..00000000000 --- a/src/pages/gen1/[platform]/prev/start/project-setup/rxjava/index.mdx +++ /dev/null @@ -1,31 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Using RxJava with Amplify', - description: 'Amplify Android has first-class support for Reactive Extensions / RxJava.', - platforms: ['android'] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - - - -import android_maintenance from '/src/fragments/lib-v1/android-maintenance.mdx'; - - - -import android0 from '/src/fragments/lib-v1/project-setup/android/rxjava/rxjava.mdx'; - - diff --git a/src/pages/gen1/[platform]/prev/start/project-setup/use-existing-resources/index.mdx b/src/pages/gen1/[platform]/prev/start/project-setup/use-existing-resources/index.mdx deleted file mode 100644 index ff1f7db688f..00000000000 --- a/src/pages/gen1/[platform]/prev/start/project-setup/use-existing-resources/index.mdx +++ /dev/null @@ -1,37 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Use existing AWS resources', - description: 'Add existing AWS resources to an application without the CLI.', - platforms: ['swift', 'android'] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -import ios_maintenance from '/src/fragments/lib-v1/ios-maintenance.mdx'; - - - -import ios0 from '/src/fragments/lib-v1/project-setup/ios/use-existing-resources/use-existing-resources.mdx'; - - - -import android_maintenance from '/src/fragments/lib-v1/android-maintenance.mdx'; - - - -import android1 from '/src/fragments/lib-v1/project-setup/android/use-existing-resources/use-existing-resources.mdx'; - - diff --git a/src/pages/gen1/[platform]/prev/tools/libraries/configure-categories/index.mdx b/src/pages/gen1/[platform]/prev/tools/libraries/configure-categories/index.mdx deleted file mode 100644 index f01f24b258c..00000000000 --- a/src/pages/gen1/[platform]/prev/tools/libraries/configure-categories/index.mdx +++ /dev/null @@ -1,51 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Configure Amplify categories', - description: - 'Configuring the client.', - platforms: [ - 'angular', - 'javascript', - 'nextjs', - 'react', - 'vue', - 'react-native' - ] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - - - -This guide is for those using the previous version of the Amplify libraries. You can also review the [updated guide for configuring Amplify categories](/gen1/[platform]/tools/libraries/configure-categories/) for the most recent version. - - - -import js0 from '/src/fragments/lib-v1/client-configuration/js/js-configuration.mdx'; - - - -import reactnative0 from '/src/fragments/lib-v1/client-configuration/js/js-configuration.mdx'; - - diff --git a/src/pages/gen1/[platform]/prev/tools/libraries/index.mdx b/src/pages/gen1/[platform]/prev/tools/libraries/index.mdx deleted file mode 100644 index ac99e2835a1..00000000000 --- a/src/pages/gen1/[platform]/prev/tools/libraries/index.mdx +++ /dev/null @@ -1,78 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; - -export const meta = { - title: 'Amplify Libraries', - description: - 'The Amplify open-source client libraries provide use-case centric, opinionated, declarative, and easy-to-use interfaces across different categories of cloud powered operations, enabling mobile and web developers to easily interact with their backends.', - platforms: [ - 'angular', - 'javascript', - 'nextjs', - 'react', - 'vue', - 'swift', - 'android', - 'flutter', - 'react-native' - ] -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - return { - props: { - platform: context.params.platform, - showBreadcrumbs: false, - meta - } - }; -} - -import ios_maintenance from '/src/fragments/lib-v1/ios-maintenance.mdx'; - - - -import android_maintenance from '/src/fragments/lib-v1/android-maintenance.mdx'; - - - -import flutter_maintenance from '/src/fragments/lib-v1/flutter-maintenance.mdx'; - - - -The Amplify open-source client libraries provide use-case centric, and easy-to-use interfaces across different categories of cloud powered operations, enabling mobile and web developers to easily interact with their backends. These libraries are powered by the AWS Cloud. The libraries can be used with both new backends created using the Amplify CLI and existing backend resources. - -import ios0 from '/src/fragments/lib-v1/ios.mdx'; - - - -import android1 from '/src/fragments/lib-v1/android.mdx'; - - - -import flutter2 from '/src/fragments/lib-v1/flutter.mdx'; - - - - - - - -If you are beginning a new project, we recommend you work with the [latest version of the Amplify libraries](/gen1/[platform]/tools/libraries/) for your chosen framework or language. - - - -## Amplify JavaScript - -The Amplify JavaScript libraries are supported for different web and mobile frameworks, including React, React Native, Angular, and Vue. - -What's next? Here are some things you can add to your app: - -- [Authentication](/gen1/[platform]/prev/build-a-backend/auth/set-up-auth/) -- [File Storage](/gen1/[platform]/prev/build-a-backend/storage/set-up-storage/) -- [Analytics](/gen1/[platform]/prev/build-a-backend/more-features/analytics/set-up-analytics/) - - diff --git a/src/pages/gen1/[platform]/reference/index.mdx b/src/pages/gen1/[platform]/reference/index.mdx deleted file mode 100644 index 8a95d1e8d7e..00000000000 --- a/src/pages/gen1/[platform]/reference/index.mdx +++ /dev/null @@ -1,37 +0,0 @@ -import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; -import { getChildPageNodes } from '@/utils/getChildPageNodes'; - -export const meta = { - title: 'Reference', - description: 'Reference', - platforms: [ - 'android', - 'angular', - 'flutter', - 'javascript', - 'nextjs', - 'react', - 'react-native', - 'swift', - 'vue' - ], - route: '/gen1/[platform]/reference' -}; - -export const getStaticPaths = async () => { - return getCustomStaticPath(meta.platforms); -}; - -export function getStaticProps(context) { - const childPageNodes = getChildPageNodes(meta.route); - return { - props: { - platform: context.params.platform, - meta, - showBreadcrumbs: false, - childPageNodes - } - }; -} - - From a06a3caa21c5017f0b7a9634ae2faac59f52a7cc Mon Sep 17 00:00:00 2001 From: Jacob Logan Date: Thu, 16 May 2024 15:55:14 -0700 Subject: [PATCH 2/2] restore linked pages --- .../graphqlapi/graphql-pagination/index.mdx | 127 ++++++++++ .../create-application/index.mdx | 72 ++++++ .../prev/start/project-setup/index.mdx | 230 ++++++++++++++++++ .../project-setup/kotlin-coroutines/index.mdx | 31 +++ .../project-setup/prerequisites/index.mdx | 111 +++++++++ .../prev/start/project-setup/rxjava/index.mdx | 31 +++ .../libraries/configure-categories/index.mdx | 51 ++++ .../[platform]/prev/tools/libraries/index.mdx | 78 ++++++ 8 files changed, 731 insertions(+) create mode 100644 src/pages/gen1/[platform]/build-a-backend/graphqlapi/graphql-pagination/index.mdx create mode 100644 src/pages/gen1/[platform]/prev/start/project-setup/create-application/index.mdx create mode 100644 src/pages/gen1/[platform]/prev/start/project-setup/index.mdx create mode 100644 src/pages/gen1/[platform]/prev/start/project-setup/kotlin-coroutines/index.mdx create mode 100644 src/pages/gen1/[platform]/prev/start/project-setup/prerequisites/index.mdx create mode 100644 src/pages/gen1/[platform]/prev/start/project-setup/rxjava/index.mdx create mode 100644 src/pages/gen1/[platform]/prev/tools/libraries/configure-categories/index.mdx create mode 100644 src/pages/gen1/[platform]/prev/tools/libraries/index.mdx diff --git a/src/pages/gen1/[platform]/build-a-backend/graphqlapi/graphql-pagination/index.mdx b/src/pages/gen1/[platform]/build-a-backend/graphqlapi/graphql-pagination/index.mdx new file mode 100644 index 00000000000..9f47a576ca6 --- /dev/null +++ b/src/pages/gen1/[platform]/build-a-backend/graphqlapi/graphql-pagination/index.mdx @@ -0,0 +1,127 @@ +import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; + +export const meta = { + title: 'GraphQL pagination', + description: 'How to implement pagination with GraphQL ', + platforms: [ + 'javascript', + 'react-native', + 'swift', + 'android', + 'angular', + 'nextjs', + 'react', + 'vue' + ] +}; + +export const getStaticPaths = async () => { + return getCustomStaticPath(meta.platforms); +}; + +export function getStaticProps(context) { + return { + props: { + platform: context.params.platform, + showBreadcrumbs: false, + meta + } + }; +} + +In this guide you will learn how to implement pagination in your GraphQL API. + +When working with a large record set, you may want to only fetch the first **N** number of items. For example, let's start with a basic GraphQL schema for a Todo app: + +```graphql +type Todo @model { + id: ID! + title: String! + description: String +} +``` + +When the API is created with an `@model` directive, the following queries will automatically be created for you: + +```graphql +type Query { + getTodo(id: ID!): Todo + listTodos( + filter: ModelTodoFilterInput + limit: Int + nextToken: String + ): ModelTodoConnection +} +``` + +Next, take a look at the `ModelTodoConnection` type to get an idea of the data that will be returned when the `listTodos` query is run: + +```graphql +type ModelTodoConnection { + items: [Todo] + nextToken: String +} +``` + +When querying the API using the `listTodos` query, the return type will be of `ModelTodoConnection`, meaning you can return both an array of `Todos` and a `nextToken`. + +The `nextToken` is what is used to handle pagination. If the `nextToken` is `null`, that means that there is no more data to return from the API. If the `nextToken` is present, you can use the value as an argument to the next `listTodos` query to return the next selection set from the API. + +To test this out, try creating 5 todos using a mutation like this: + +```sh +mutation createTodo { + createTodo(input: { + title: "Todo 1" + description: "My first todo" + }) { + id + title + description + } +} +``` + +Next, you can set the limit of the number of todos in a query by passing in a `limit` argument. In this query, you'll set the limit to 2 items and request a `nextToken` as a return value: + +```graphql +query listTodos { + listTodos(limit: 2) { + items { + id + title + description + } + nextToken + } +} +``` + +Now, to query the next 2 items from the API, you can pass this `nextToken` as the argument: + +```graphql +query listTodos { + listTodos(limit: 2, nextToken: ) { + items { + id + title + description + } + nextToken + } +} +``` + +When there are no other items left to be returned, the `nextToken` in the response will be set to null. + +import js0 from '/src/fragments/guides/api-graphql/js/graphql-pagination.mdx'; + + diff --git a/src/pages/gen1/[platform]/prev/start/project-setup/create-application/index.mdx b/src/pages/gen1/[platform]/prev/start/project-setup/create-application/index.mdx new file mode 100644 index 00000000000..9fc9df250ee --- /dev/null +++ b/src/pages/gen1/[platform]/prev/start/project-setup/create-application/index.mdx @@ -0,0 +1,72 @@ +import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; + +export const meta = { + title: 'Amplify project setup', + description: + 'Set up Amplify prerequisites and a project.', + platforms: [ + 'angular', + 'javascript', + 'nextjs', + 'react', + 'vue', + 'swift', + 'android', + 'flutter', + 'react-native' + ] +}; + +export const getStaticPaths = async () => { + return getCustomStaticPath(meta.platforms); +}; + +export function getStaticProps(context) { + return { + props: { + platform: context.params.platform, + showBreadcrumbs: false, + meta + } + }; +} + +import ios_maintenance from '/src/fragments/lib-v1/ios-maintenance.mdx'; + + + +import flutter_maintenance from '/src/fragments/lib-v1/flutter-maintenance.mdx'; + + + +import ios0 from '/src/fragments/lib-v1/project-setup/native_common/create-application/common.mdx'; + + + +import android_maintenance from '/src/fragments/lib-v1/android-maintenance.mdx'; + + + +import android1 from '/src/fragments/lib-v1/project-setup/native_common/create-application/common.mdx'; + + + +import flutter2 from '/src/fragments/lib-v1/project-setup/native_common/create-application/common.mdx'; + + + +import react_native2 from '/src/fragments/start/getting-started/reactnative/setup.mdx'; + + + +import js0 from '/src/fragments/lib-v1/project-setup/js/getting-started.mdx'; + + diff --git a/src/pages/gen1/[platform]/prev/start/project-setup/index.mdx b/src/pages/gen1/[platform]/prev/start/project-setup/index.mdx new file mode 100644 index 00000000000..c94953db91c --- /dev/null +++ b/src/pages/gen1/[platform]/prev/start/project-setup/index.mdx @@ -0,0 +1,230 @@ +import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; + +export const meta = { + title: 'Amplify project setup', + description: + 'Set up Amplify prerequisites and a project.', + platforms: [ + 'angular', + 'javascript', + 'nextjs', + 'react', + 'vue', + 'swift', + 'android', + 'flutter', + 'react-native' + ] +}; + +export const getStaticPaths = async () => { + return getCustomStaticPath(meta.platforms); +}; + +export function getStaticProps(context) { + return { + props: { + platform: context.params.platform, + showBreadcrumbs: false, + meta + } + }; +} + + + +We recommend that you use the [latest version for project setup](/gen1/[platform]/start/project-setup/) for your chosen framework or language. + +This page is a reference for those who need the previous version and includes all project setup content for that version. Selecting the navigation menu will take you back to the current version by default. + + + +import ios_maintenance from '/src/fragments/lib-v1/ios-maintenance.mdx'; + + + +import ios0 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_header.mdx'; + + + +import android_maintenance from '/src/fragments/lib-v1/android-maintenance.mdx'; + + + +import flutter_maintenance from '/src/fragments/lib-v1/flutter-maintenance.mdx'; + + + +import android0 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_header.mdx'; + + + +import reactnative0 from '/src/fragments/lib/project-setup/native_common/prereq/common_header.mdx'; + + + +import js0 from '/src/fragments/lib/project-setup/native_common/prereq/common_header.mdx'; + + + +import ios1 from '/src/fragments/lib-v1/project-setup/ios/prereq/prereq.mdx'; + + + +import android1 from '/src/fragments/lib-v1/project-setup/android/prereq/prereq.mdx'; + + + +import ios2 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_body.mdx'; + + + +import android2 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_body.mdx'; + + + +import flutter0 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_header.mdx'; + + + +import flutter1 from '/src/fragments/lib-v1/project-setup/flutter/prereq/prereq.mdx'; + + + +import flutter2 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_body.mdx'; + + + +import js1 from '/src/fragments/lib/project-setup/native_common/prereq/common_body.mdx'; + + + +import reactnative1 from '/src/fragments/lib/project-setup/native_common/prereq/common_body.mdx'; + + + +## Create your application + +import ios3 from '/src/fragments/lib-v1/project-setup/native_common/create-application/common.mdx'; + + + +import android3 from '/src/fragments/lib-v1/project-setup/native_common/create-application/common.mdx'; + + + +import flutter3 from '/src/fragments/lib-v1/project-setup/native_common/create-application/common.mdx'; + + + +import react_native2 from '/src/fragments/start/getting-started/reactnative/setup.mdx'; + + + +import js2 from '/src/fragments/lib-v1/project-setup/js/getting-started.mdx'; + + + + + +## Further customization + + + + + +## Async Programming Model + +import android4 from '/src/fragments/lib-v1/project-setup/android/async/async.mdx'; + + + + + + + +## Kotlin Coroutines support + +import android5 from '/src/fragments/lib-v1/project-setup/android/coroutines/coroutines.mdx'; + + + + + + + +## Using RxJava with Amplify + +import android6 from '/src/fragments/lib-v1/project-setup/android/rxjava/rxjava.mdx'; + + + + + + + +## Platform setup + +import flutter4 from '/src/fragments/lib-v1/project-setup/flutter/platform-setup/platform-setup.mdx'; + + + + + + + +## Escape hatch + +import flutter5 from '/src/fragments/lib-v1/project-setup/flutter/escape-hatch/escape-hatch.mdx'; + + + + + + + +## Use the Combine framework with Amplify + +import ios4 from '/src/fragments/lib-v1/project-setup/ios/combine/combine.mdx'; + + + + + + + +## Use existing AWS resources + +import ios5 from '/src/fragments/lib-v1/project-setup/ios/use-existing-resources/use-existing-resources.mdx'; + + + +import android7 from '/src/fragments/lib-v1/project-setup/android/use-existing-resources/use-existing-resources.mdx'; + + + + diff --git a/src/pages/gen1/[platform]/prev/start/project-setup/kotlin-coroutines/index.mdx b/src/pages/gen1/[platform]/prev/start/project-setup/kotlin-coroutines/index.mdx new file mode 100644 index 00000000000..c26cc7b98e5 --- /dev/null +++ b/src/pages/gen1/[platform]/prev/start/project-setup/kotlin-coroutines/index.mdx @@ -0,0 +1,31 @@ +import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; + +export const meta = { + title: 'Kotlin Coroutines support', + description: 'Amplify Android includes first-class support for Kotlin Coroutines and Flows.', + platforms: ['android'] +}; + +export const getStaticPaths = async () => { + return getCustomStaticPath(meta.platforms); +}; + +export function getStaticProps(context) { + return { + props: { + platform: context.params.platform, + showBreadcrumbs: false, + meta + } + }; +} + + + +import android_maintenance from '/src/fragments/lib-v1/android-maintenance.mdx'; + + + +import android0 from '/src/fragments/lib-v1/project-setup/android/coroutines/coroutines.mdx'; + + diff --git a/src/pages/gen1/[platform]/prev/start/project-setup/prerequisites/index.mdx b/src/pages/gen1/[platform]/prev/start/project-setup/prerequisites/index.mdx new file mode 100644 index 00000000000..eb8a3ee9080 --- /dev/null +++ b/src/pages/gen1/[platform]/prev/start/project-setup/prerequisites/index.mdx @@ -0,0 +1,111 @@ +import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; + +export const meta = { + title: 'Set up Amplify prerequisites', + description: 'Project setup with Amplify - Prerequisites', + platforms: [ + 'javascript', + 'swift', + 'android', + 'flutter', + 'react-native', + 'angular', + 'nextjs', + 'react', + 'vue' + ] +}; + +export const getStaticPaths = async () => { + return getCustomStaticPath(meta.platforms); +}; + +export function getStaticProps(context) { + return { + props: { + platform: context.params.platform, + showBreadcrumbs: false, + meta + } + }; +} + +import ios_maintenance from '/src/fragments/lib-v1/ios-maintenance.mdx'; + + + +import ios0 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_header.mdx'; + + + +import android_maintenance from '/src/fragments/lib-v1/android-maintenance.mdx'; + + + +import flutter_maintenance from '/src/fragments/lib-v1/flutter-maintenance.mdx'; + + + +import android1 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_header.mdx'; + + + +import reactnative0 from '/src/fragments/lib/project-setup/native_common/prereq/common_header.mdx'; + + + +import js0 from '/src/fragments/lib/project-setup/native_common/prereq/common_header.mdx'; + + + +import ios3 from '/src/fragments/lib-v1/project-setup/ios/prereq/prereq.mdx'; + + + +import android4 from '/src/fragments/lib-v1/project-setup/android/prereq/prereq.mdx'; + + + +import ios6 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_body.mdx'; + + + +import android7 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_body.mdx'; + + + +import flutter2 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_header.mdx'; + + + +import flutter5 from '/src/fragments/lib-v1/project-setup/flutter/prereq/prereq.mdx'; + + + +import flutter8 from '/src/fragments/lib-v1/project-setup/native_common/prereq/common_body.mdx'; + + + +import js1 from '/src/fragments/lib/project-setup/native_common/prereq/common_body.mdx'; + + + +import reactnative1 from '/src/fragments/lib/project-setup/native_common/prereq/common_body.mdx'; + + diff --git a/src/pages/gen1/[platform]/prev/start/project-setup/rxjava/index.mdx b/src/pages/gen1/[platform]/prev/start/project-setup/rxjava/index.mdx new file mode 100644 index 00000000000..b841011fc25 --- /dev/null +++ b/src/pages/gen1/[platform]/prev/start/project-setup/rxjava/index.mdx @@ -0,0 +1,31 @@ +import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; + +export const meta = { + title: 'Using RxJava with Amplify', + description: 'Amplify Android has first-class support for Reactive Extensions / RxJava.', + platforms: ['android'] +}; + +export const getStaticPaths = async () => { + return getCustomStaticPath(meta.platforms); +}; + +export function getStaticProps(context) { + return { + props: { + platform: context.params.platform, + showBreadcrumbs: false, + meta + } + }; +} + + + +import android_maintenance from '/src/fragments/lib-v1/android-maintenance.mdx'; + + + +import android0 from '/src/fragments/lib-v1/project-setup/android/rxjava/rxjava.mdx'; + + diff --git a/src/pages/gen1/[platform]/prev/tools/libraries/configure-categories/index.mdx b/src/pages/gen1/[platform]/prev/tools/libraries/configure-categories/index.mdx new file mode 100644 index 00000000000..f01f24b258c --- /dev/null +++ b/src/pages/gen1/[platform]/prev/tools/libraries/configure-categories/index.mdx @@ -0,0 +1,51 @@ +import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; + +export const meta = { + title: 'Configure Amplify categories', + description: + 'Configuring the client.', + platforms: [ + 'angular', + 'javascript', + 'nextjs', + 'react', + 'vue', + 'react-native' + ] +}; + +export const getStaticPaths = async () => { + return getCustomStaticPath(meta.platforms); +}; + +export function getStaticProps(context) { + return { + props: { + platform: context.params.platform, + showBreadcrumbs: false, + meta + } + }; +} + + + +This guide is for those using the previous version of the Amplify libraries. You can also review the [updated guide for configuring Amplify categories](/gen1/[platform]/tools/libraries/configure-categories/) for the most recent version. + + + +import js0 from '/src/fragments/lib-v1/client-configuration/js/js-configuration.mdx'; + + + +import reactnative0 from '/src/fragments/lib-v1/client-configuration/js/js-configuration.mdx'; + + diff --git a/src/pages/gen1/[platform]/prev/tools/libraries/index.mdx b/src/pages/gen1/[platform]/prev/tools/libraries/index.mdx new file mode 100644 index 00000000000..ac99e2835a1 --- /dev/null +++ b/src/pages/gen1/[platform]/prev/tools/libraries/index.mdx @@ -0,0 +1,78 @@ +import { getCustomStaticPath } from '@/utils/getCustomStaticPath'; + +export const meta = { + title: 'Amplify Libraries', + description: + 'The Amplify open-source client libraries provide use-case centric, opinionated, declarative, and easy-to-use interfaces across different categories of cloud powered operations, enabling mobile and web developers to easily interact with their backends.', + platforms: [ + 'angular', + 'javascript', + 'nextjs', + 'react', + 'vue', + 'swift', + 'android', + 'flutter', + 'react-native' + ] +}; + +export const getStaticPaths = async () => { + return getCustomStaticPath(meta.platforms); +}; + +export function getStaticProps(context) { + return { + props: { + platform: context.params.platform, + showBreadcrumbs: false, + meta + } + }; +} + +import ios_maintenance from '/src/fragments/lib-v1/ios-maintenance.mdx'; + + + +import android_maintenance from '/src/fragments/lib-v1/android-maintenance.mdx'; + + + +import flutter_maintenance from '/src/fragments/lib-v1/flutter-maintenance.mdx'; + + + +The Amplify open-source client libraries provide use-case centric, and easy-to-use interfaces across different categories of cloud powered operations, enabling mobile and web developers to easily interact with their backends. These libraries are powered by the AWS Cloud. The libraries can be used with both new backends created using the Amplify CLI and existing backend resources. + +import ios0 from '/src/fragments/lib-v1/ios.mdx'; + + + +import android1 from '/src/fragments/lib-v1/android.mdx'; + + + +import flutter2 from '/src/fragments/lib-v1/flutter.mdx'; + + + + + + + +If you are beginning a new project, we recommend you work with the [latest version of the Amplify libraries](/gen1/[platform]/tools/libraries/) for your chosen framework or language. + + + +## Amplify JavaScript + +The Amplify JavaScript libraries are supported for different web and mobile frameworks, including React, React Native, Angular, and Vue. + +What's next? Here are some things you can add to your app: + +- [Authentication](/gen1/[platform]/prev/build-a-backend/auth/set-up-auth/) +- [File Storage](/gen1/[platform]/prev/build-a-backend/storage/set-up-storage/) +- [Analytics](/gen1/[platform]/prev/build-a-backend/more-features/analytics/set-up-analytics/) + +