Git Product home page Git Product logo

delivery's Introduction

Deployment project

1. Setup configs in folder configs in files:

  • dev.json
  • prod.json

If need to change configs only for local environment you should add to this folder file local.json and override any configs from the dev.json and prod.json files.

2. Execute next commands:

npm i
npm run create
npm run sync
npm run fill    # optional

Description of all commands see in the end of this documentation.

Running application

1. Go to the server folder and execute:

npm run start

or run server with autorestarting mode:

npm run debug

2. Open in browser next link: http://localhost:3003

Server NPM commands

npm run start      // running server in production mode
npm run debug      // running server in development mode with autorestaring option (for Unix systems)
npm run debugw     // running server in development mode with autorestaring option (for Windows system)
npm run create     // create empty database by configs
npm run sync       // create/recreate tables in database
npm run fill       // add test data to tables
npm run drop       // absolutely remove database
npm run recreate   // sequence of the drop, create and sync commands
npm run reinstall  // remove "node_modules" folder and "package-lock.json" file and install again

Server API

For using server API you should send all requests by the next rules:

  • URL: /api
  • method: POST
  • body:
{
  "action": "foo",
  "method": "bar",
  "data": [
    {
      "someData": 123
    }
  ],
  "tid": 1,
  "type": "rpc"
}

Details:

  • URL value you can get from the configs > direct > classRouteUrl parameter;
  • params in the body:
    • action is the file name from the folder server/api (exclude index.js file) without extension;
    • method is the function name which exports from the action file;
    • data is any data which you want to send to the server to method function; IMPORTANT!: data parameter should be an array with only one object inside;
    • tid is the number of request; actually can be any integer number;
    • type should be always rpc.

delivery's People

Contributors

unscored avatar vitaliimarushko avatar

Stargazers

kamal avatar

Watchers

 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.