Skip to content
Kristiqn Tachev edited this page Mar 6, 2021 · 1 revision

gapi start

Overview

gapi start

This command will start the application with nodemon and compile on runtime with ts-node then you can open http://localhost:9000 to see your application working.

Run start with different environment
It will take "local" default configuration from gapi-cli.conf.yml

Custom environments

config:
  app:
    local: 
      API_PORT: 9000
      API_CERT: ./cert.key
      NODE_ENV: development
      AMQP_HOST: 182.10.0.5
      AMQP_PORT: 5672
      ENDPOINT_TESTING: http://localhost:9000/graphql
      TOKEN_TESTING: ''
    prod: 
      API_PORT: 9000
      API_CERT: ./cert.key
      NODE_ENV: production
      AMQP_HOST: 182.10.0.5
      AMQP_PORT: 5672
      ENDPOINT_TESTING: http://182.10.0.101:9000/graphql
      TOKEN_TESTING: ''
    my-environment: 
      API_PORT: 9000
      API_CERT: ./cert.key
      NODE_ENV: development
      AMQP_HOST: 182.10.0.5
      AMQP_PORT: 5672
      ENDPOINT_TESTING: http://localhost:9000/graphql
      TOKEN_TESTING: ''
Running with local environment
gapi start

Running with Production environment

gapi start --prod
Running with custom enviroment
gapi start --my-enviroment

Extending configuration

You can extend configurations from APP when you write after environment "extends app/my-environment"

Custom testing environments

config:
  app:
    local: 
      API_PORT: 9000
      API_CERT: ./cert.key
      NODE_ENV: development
      AMQP_HOST: 182.10.0.5
      AMQP_PORT: 5672
      ENDPOINT_TESTING: http://localhost:9000/graphql
      TOKEN_TESTING: ''
    prod: 
      API_PORT: 9000
      API_CERT: ./cert.key
      NODE_ENV: production
      AMQP_HOST: 182.10.0.5
      AMQP_PORT: 5672
      ENDPOINT_TESTING: http://182.10.0.101:9000/graphql
      TOKEN_TESTING: ''
    my-environment: extends app/local
  test:
    my-environment: extends app/my-environment
    local: extends app/local
    prod: extends app/prod
    worker: extends app/prod

Parcel JS

gapi start --local --parcel

Debug

gapi start --local --parcel --inspect

Debug with breakpoint

gapi start --local --parcel --inspect-brk

Debug with breakpoint and lint

gapi start --local --lint --parcel --inspect-brk

You have to define command lint in your package.json