Skip to content

Guideline API Core Config

Van Toan edited this page Sep 20, 2020 · 1 revision

How to use API Core Config

Every project has its defined structure follow GAM Core.

  • src (source code root folder).
  • |- config (contains all server config).
  • |- controller (contains all controller objects).
  • |- model (contains all model objects).
  • |- route (contains all route objects).
  • |- service (contains all controller service objects).
  • |- utils (contains all utilities functions).
  • |- view (contains all template/view objects).
  • |- web (contains all web resources).

Config structure.

Use one/some of those following file for specific server types.

  • common.js (define common in the server, other config file use this file as base and override by their own files).

  • app.js (define as a second common file, same as common.js but it override common.js before to be a base for other file).

  • api.js (define all api server config).

  • chat.js (define all chat server config).

  • cronjob.js (define all cronjob server config).

  • udp.js (define all udp server config).

  • tcp.js (define all tcp server config).

  • web.js (define all web server config).

  • ftp.js (define all ftp server config).

  • mail.js (define all mail server config).

  • mongo.js (define all mongodb config, main database in the server).

  • redis.js (define all redis config, main session cache in the server).

  • report.js (define all report config, used to send data to OMS server).

  • statistic.js (define all statistic config, used to send user request statistics to OMS server).

  • firebase.js define all firebase service config.

  • sms.js define all sms service config.