Skip to content

Campaign preview via browser #3

@rykov

Description

@rykov

This will work by exposing a "localhost" API endpoint from the CLI, and use a hosted single page Javascript app to call the API (with Cross-Origin Resource Sharing) to render the results:

  • GraphQL API in CLI
    • Add "server" command to start server
    • Add "preview" command to start server and open browser preview
    • Expose version API to connection/compatibility check
    • Expose single email rendering API
  • Javascript app
    • Create and configure Ember.js app build
    • Choose reconfigurable client-side API library
    • Add "connect" route to configure API client
    • Add "render" route to show rendered email
    • Add compatibility check to "connect" route
    • Add error handling for "connect" route
    • Add error handling for "render" route
    • Create manual connect flow

Things to consider:

We are calling a "localhost" API that cannot use HTTPS due to lack of a valid certificate. Thus browser security policy will not allow our Javascript preview app to call an HTTP API, unless the app is loaded via HTTP as well. (Secure pages cannot load unsecured resources). This may be ok, or we may need to proxy the whole page through the CLI to secure the remote connection:

Browser <--[http]--> CLI <--[https]--> Hosted JS app

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions