Giter VIP home page Giter VIP logo

configtool's Introduction

Configtool

A screenshot of Configtool in action

Test data from https://randomuser.me/

Choose and edit a remote JSON file with standard dot-syntax, then save it or host on the local network. Built with Express.

Usage

  1. Load your JSON, selected using your parameters (see 'Set up' below).
  2. Make your changes in the left-hand pane. The key should be a normal JSON accessor. The value can be a primitive or another JSON object.
  3. Use the /modified.json endpoint to access your changes live (for example, mapping with a proxy like Postman or Charles), or
  4. Save your changes and download to a new JSON file.

Set up

Sources for JSON files are provided by resolve.js. Two functions must be implemented, as in the example below.

/**
 * The parameters used to get different variations of your JSON. 
 * The key is the parameter name, the list are the values for the dropdown
 */
exports.getFileParameters = async function (req) {
  return {
    version: [1, 2, 3],
    environment: ["linux", "mac", "windows"],
  }
};

/**
 * Resolve the URL for the config to be edited, using the parameters from 
 * the dropdowns (or any other parameters/logic you want)
 */
exports.resolveConfigUrl = async function (params) {
  const { version, environment } = params;

  const url = `https://example.com/myFile-v${version}-${environment}.json`

  return url;
};

The first method provides the parameters for selecting your JSON file. The second method resolves those parameters to the URL of that JSON file. You can use any logic in either method for determining which URL to pass to the JSON loader, the parameters just allow you to select this from the frontend.

Running Configtool

npm -i npm run app

configtool's People

Contributors

jack-webb avatar

Watchers

 avatar

configtool's Issues

Allow multiple modified JSON files to be created/hosted

Once a file has been modified, it should be hosted on a new endpoint, so it can be used even after other modifications are made. These could be temporary, like a gist or pastebin but for our config.

They would need to show in the UI too, maybe as a modification history, probably bottom-right. Not sure what the preview for this would look like, but would need copy URL and delete as a minimum.

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.