当前位置: 首页 > 软件库 > 云计算 > >

aws-amplify-vue

A Vue.js starter app integrated with AWS Amplify
授权协议 Apache-2.0 License
开发语言 JavaScript
所属分类 云计算
软件类型 开源软件
地区 不详
投 递 者 马冯浩
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

AWS Amplify Vue Starter

A VueJs starter app integrated with aws-amplify. Please submit issues to the aws-amplify repository.

Getting Started

  1. Clone project and install dependencies
$ git clone https://github.com/aws-samples/aws-amplify-vue.git
$ cd aws-amplify-vue-sample
$ npm install
  1. Copy your aws-exports file into the src directory, or intialize a new AWS Amplify CLI project:
$ npm install -g @aws-amplify/cli

$ amplify init

$ amplify add auth
$ > Yes, use the default configuration.

$ amplify add storage
$ > Content (Images, audio, video, etc.)
...
$ > Auth users only
$ > read/write

$ amplify add api
$ > GraphQL
...
$ > Amazon Cognito User Pool
$ Do you have an annotated GraphQL schema? N
$ Do you want a guided schema creation? Y
$ > Single object with fields (e.g. "Todo" with id, name description)
$ Do you want to edit the schema now? Y

  type Todo @model {
  id: ID!
  note: String!
  done: Boolean
}

$ amplify push
$ Do you want to generate code for your newly created GraphQL API N
  1. Start the project
$ npm start

Check http://localhost:8080/

Setup AWS Amplify

It is recommended to configure Amplify library at the entry point of application. Here we choose main.js

import Amplify from 'aws-amplify';
import { components } from 'aws-amplify-vue'; 
import aws_exports from './aws-exports'

...

Amplify.configure(aws_exports)

...

new Vue({
  el: '#app',
  router: router,
  template: '<App/>',
  components: { 
    App,
    ...components
  }
})

We then install the AmplifyPlugin in the application's router/index.js file:

import { AmplifyPlugin } from 'aws-amplify-vue';

...


Vue.use(AmplifyPlugin, AmplifyModules);

This makes the Amplify library available throughout the application as a Vue Plugin.

Authentication Components

This sample uses three auth-related components from the aws-amplify-vue package:

  • Authenticator

    • allows new users to signup, signin, and complete verification/multifactor authentication steps.
    • included in the router as the default route that is shown when the user is not logged in.
  • SetMFA

    • included in the profile page
    • allows users to select their preferred MFA types
    • you can configure the MFA options that are dispayed in the SetMFA component by binding a mfaConfig object to the component like so:
    <amplify-set-mfa v-bind:mfaConfig="mfaConfig"></amplify-set-mfa>
    
    ...
    
    mfaConfig = {
      mfaTypes: ['SMS', 'TOTP', 'None']
    }
    
    

Storage Components

In this sample, src/amplify package register a group of Amplify related components. Other than Auth components, there are two storage related components:

  • PhotoPicker
    • showcase usage of Amplify Storage on binary data uploads
  • S3Image
    • showcase usage of Amplify Storage on binary data display

Logging

This application uses verbose logging by default. You can change the log level by altering the line window.LOG_LEVEL = 'VERBOSE'; in App.vue.

License

This library is licensed under the Apache 2.0 License.

  • react 服务器 by Peter Mbanugo 彼得·姆巴努戈(Peter Mbanugo) 使用React和AWS Amplify进入无服务器服务第2部分:创建和使用无服务器服务 (Going serverless with React and AWS Amplify Part 2: Creating And Using Serverless Services) Serverless is

  • 使用 GraphQL 构建 VueJS 应用 零、前言 一、数据绑定、事件和计算属性 二、组件、混合器和功能组件 三、设置我们的聊天应用——AWS Amplify 环境和 GraphQL 四、创建自定义应用组件和布局 五、创建用户 Vuex 模块、页面和路由 六、创建聊天和消息 Vuex、页面和路由 七、将您的应用程序转换为 PWA 并部署到 Web VueJS2 Web 开发完全手册 零、前言

  • 本地测试通过以后,build以后会有一个dist文件夹生成。讲次文件夹下的所有东西直接拷贝到S3 bucket下面。(index.html必须必须直接在桶下面!) 然后讲S3设置成为静态网页。采用了vue-router,并且有windows.open的情况下,务必将error.html(错误跳转也设置成index.html)。 网站访问权限就是S3的访问权限。参考策略。 以上是最快最简单的。 下面

 相关资料
  • 用于使用云服务进行应用程序开发的声明性 JavaScript 库。 AWS Amplify 为不同类别的云操作提供了一个声明性且易于使用的界面。 AWS Amplify 适用于任何基于 JavaScript 的前端工作流程,适用于移动开发人员的 React Native。 我们的默认实现适用于亚马逊网络服务(AWS),但 AWS Amplify 旨在为任何自定义后端或服务开放和可插入。 特性/AP

  • Awesome AWS Amplify curates the best AWS Amplify, tools, tutorials, articles and more. PRs are welcome! Check out the Amplify Discord server Getting Started Github Documentation Workshops Serverless G

  • Amplify是否支持此处概述的脱机功能:https://docs.aws.amazon.com/appsync/latest/devguide/building-a-client-app-react.html#offline-背景 我应该这样设置吗?https://aws.github.io/aws-amplify/media/api_guide#configuration-for-graphq

  • Gatsby Auth starter with AWS Amplify This auth starter implements a basic authentication flow for signing up signing in users as well as protected client side routing using AWS Amplify. Auth features:

  • 尝试使用官方网站上给出的命令安装CLI,响应如下: 我已经安装了node和npm的最新版本。修复此问题将非常有用。TIA公司

  • 在浏览器控制台日志中: 如何解决这个问题。 我试图通过删除并重新添加Auth“amplify Auth remove”、“amplify Auth add”,然后是“amplify update api”和“amplify push”来修复它,但这并没有什么不同。 在"C:\myproject\放大\backend\auth"中,身份验证桶的目录包含parameters.json,在我看来没问题。