Code Monkey home page Code Monkey logo

aws-amplify-webapp's Introduction

aws-amplify-webapp

Create new app

  1. mkdir src

  2. touch package.json index.html webpack.config.js src/app.js

  3. Add lines to package.json { "name": "amplify-js-app", "version": "1.0.0", "description": "Amplify JavaScript Example", "dependencies": { "@aws-amplify/api": "latest", "@aws-amplify/pubsub": "latest" }, "devDependencies": { "webpack": "^4.17.1", "webpack-cli": "^3.1.0", "copy-webpack-plugin": "^4.5.2", "webpack-dev-server": "^3.1.5" }, "scripts": { "start": "webpack && webpack-dev-server --mode development", "build": "webpack" } }

  4. npm install

  5. Add lines to index.html

    <title>Amplify Framework</title> <style> html, body { font-family: "Amazon Ember", "Helvetica", "sans-serif"; margin: 0; } a { color: #FF9900; } h1 { font-weight: 300; } .app { width: 100%; } .app-header { color: white; text-align: center; background: linear-gradient(30deg, #f90 55%, #FFC300); width: 100%; margin: 0 0 1em 0; padding: 3em 0 3em 0; box-shadow: 1px 2px 4px rgba(0, 0, 0, .3); } .app-logo { width: 126px; margin: 0 auto; } .app-body { width: 400px; margin: 0 auto; text-align: center; } .app-body button { background-color: #FF9900; font-size: 14px; color: white; text-transform: uppercase; padding: 1em; border: none; } .app-body button:hover { opacity: 0.8; } </style>
    AWS Amplify

    Welcome to the Amplify Framework

    Add data
    <script src="main.bundle.js"></script>
  6. Add lines to webpack.config.js const CopyWebpackPlugin = require('copy-webpack-plugin'); const webpack = require('webpack'); const path = require('path');

    module.exports = { mode: 'development', entry: './src/app.js', output: { filename: '[name].bundle.js', path: path.resolve(__dirname, 'dist') }, module: { rules: [ { test: /.js$/, exclude: /node_modules/ } ] }, devServer: { contentBase: './dist', overlay: true, hot: true }, plugins: [ new CopyWebpackPlugin(['index.html']), new webpack.HotModuleReplacementPlugin() ] };

  7. npm start

Create the backend

  1. amplify init -> use default values
  2. amplify status
  3. amplify hosting add
  4. amplify publish

aws-amplify-webapp's People

Contributors

mat-srm avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.