Giter Site home page Giter Site logo

adobeio-samples-custom-events's Introduction

Custom Event Demo code

This is the source code of codelabs-custom-event

Step 1: to register your app as event provider, follow here

Setup

  • Populate the .env file in the project root and fill it as shown below (if you clone this repo please rename dotenv file to .env)
  • fill in the manifest.ymp with orgId, apiKey, accessToken from console integration and providerId and eventCode from step 1: register your app as event provider

Local Dev

  • aio app run to start your local Dev server
  • App will run on localhost:9080 by default

By default the UI will be served locally but actions will be deployed and served from Adobe I/O Runtime. To start a local serverless stack and also run your actions locally use the aio app run --local option.

Test & Coverage

  • Run aio app test to run unit tests for ui and actions
  • Run aio app test -e to run e2e tests

Deploy & Cleanup

  • aio app deploy to build and deploy all actions on Runtime and static files to CDN
  • aio app undeploy to undeploy the app

Config

.env

# This file should not be committed to source control

## please provide your Adobe I/O Runtime credentials
# AIO_RUNTIME_AUTH=
# AIO_RUNTIME_NAMESPACE=

package.json

  • We use the name and version fields for the deployment. Make sure to fill those out. Do not use illegal characters as this might break the deployment (e.g. /, @, #, ..).

Action Dependencies

  • You have two options to resolve your actions' dependencies:

    1. Packaged action file: Add your action's dependencies to the root package.json and install them using npm install. Then set the function field in manifest.yml to point to the entry file of your action folder. We will use parcelJS to package your code and dependencies into a single minified js file. The action will then be deployed as a single file. Use this method if you want to reduce the size of your actions.

    2. Zipped action folder: In the folder containing the action code add a package.json with the action's dependencies. Then set the function field in manifest.yml to point to the folder of that action. We will install the required dependencies within that directory and zip the folder before deploying it as a zipped action. Use this method if you want to keep your action's dependencies separated.

Debugging in VS Code

While running your local server (aio app run), both UI and actions can be debugged, to do so open the vscode debugger and select the debugging configuration called WebAndActions. Alternatively, there are also debug configs for only UI and each separate action.

adobeio-samples-custom-events's People

Contributors

yu1986 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

isabella232

adobeio-samples-custom-events's Issues

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.