GithubHelp home page GithubHelp logo

zesty-io / zesty-instance-download-demo Goto Github PK

View Code? Open in Web Editor NEW
0.0 4.0 0.0 7 KB

Demo code for pulling down view, stylesheet and script resources from a Zesty.io instance.

License: MIT License

JavaScript 100.00%
zesty-io zestyio

zesty-instance-download-demo's Introduction

Zesty Instance Download

Introduction

Example code that shows one way of downloading files from a Zesty.io instance to the local filesystem.

This will download:

  • Views (including AJAX and Endpoint views).
  • Stylesheets.
  • Scripts.

This will not currently download:

  • Linked stylesheet and JavaScript resources (those which show with a planet icon in the Zesty.io Editor).

Setup

To set this up you'll need to clone the repo, install dependencies, then set some environment variables.

You will need the following information about your Zesty instance:

  • Instance ZUID.
  • Access token.

These items can be obtained from the "External Editing" tab in your Zesty.io instance's Editor. Note that the access token is session based, and will expire when you logout or after a period of inactivity on Zesty.io.

To get started:

$ git clone https://github.com/zesty-io/zesty-instance-download-demo.git
$ cd zesty-instance-download-demo
$ npm install
$ export ZESTY_INSTANCE_ZUID=<your instance ZUID>
$ export ZESTY_ACCESS_TOKEN=<your access token>
$ npm start

Results

Downloaded files will be placed into a folder called output. Inside that you can expect to find further folders:

  • views: Contains view templates from your instance. If you are using endpoints with fully qualified paths, these will be placed in nested folders e.g. /very/deep/path/item.json will be found in views/very/deep/path/item.json.
  • styles: Contains CSS, LESS or SCSS files from your instance.
  • js: Contains JavaScript files from your instance.

Note, this script will pull the dev (unpublished) versions of these files. You may also wish to pull the live versions (published). To do this, edit index.js and change:

const ENVIRONMENT_TO_USE = 'dev'

to

const ENVIRONMENT_TO_USE = 'live'

zesty-instance-download-demo's People

Watchers

 avatar  avatar  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.