Project File Organizations

Project Files organization

We use following command to start a restbird container:

docker run -ti -p {host-port}:8080 -v {path-to-project}:/data/restbird restbird/rest

The path-to-project is a folder on host OS that is map to the restbird container. All project files will be saved in this folder. you can use git, svn or any other verson controller tools to mange the project files on your host.

Once the restbird container start to run, it will setup the project files hirachy like this:

├── library                      # all third party or shared libraries for golang 
├── libraryPy                    # all third party or shared libraries for python
├── libraryJs                    # all third party or shared libraries for javascript
├── projects
│   ├── examples                 # all programming example/snips for golang/python/javascripts are here
│   ├── mock                     # all mock server project cases are under this folder
│   │   └── test
│   │       └── hello
│   │           ├── api0         # define the mock api #0  
│   │           │   ├── mock.js
│   │           │   ├── req.json
│   │           │   └── res.body
│   │           ├── api1         # define the mock api #1
│   │           │   ├── mock.js
│   │           │   ├── req.json
│   │           │   └── res.body
│   │           ├── mock.json
│   │           ├── mocktask.js
│   │           └── type.json
│   ├── record                 # all recorder project cases are under this folder
│   │   └── test
│   │       └── github
│   │           ├── record.json
│   │           └── type.json
│   ├── rest                  # all the rest project cases are under this folder
│   │   └── test
│   │       └── hello-google
│   │           ├── api0     # a rest api definition of case 'hello-google'     
│   │           │   ├── prerequest.go
│   │           │   ├── req.body
│   │           │   ├── req.json
│   │           │   └── resval.go
│   │           ├── api1
│   │           │   ├── prerequest.go
│   │           │   ├── req.json
│   │           │   └── resval.go
│   │           ├── api2
│   │           │   ├── prerequest.go
│   │           │   ├── req.json
│   │           │   └── resval.go
│   │           └── type.json
│   ├── task             # all tasks definitions are under this folder
│   └── env              # environment varibles definition which will be used by rest projects.
│   └── user             # restbird portal admin/user are defined here
├── state                # all runing history and mock server state(DB) are under this folder
└── version.json         # restbird version infomation

Description:

  • versio.json : this file contained the restbird version infomation of this project. Never modify this file yourselves.
  • projects : this is the most import directory. All the project files are under this directory.

    • rest : save all project files of “rest” projects
    • record : save all project files of “recording” projects
    • mock : save all project files of “mock server” projects.
    • task : save all profile files of “task” projects.
    • env : save all the “environment varibles” definition, which will be used by rest projects.
    • user : save the admin/user.
    • examples : save all programming snips.
  • state : store the rest api runing history, recorded apis, mock server state(DB), and global varible values.
  • library: store any 3rd party go libraries or your own libraries that will be used by golang programming.
  • libraryPy: store any 3rd party go libraries or your own libraries that will be used by python programming.
  • libraryJs: store any 3rd party go libraries or your own libraries that will be used by JavaScript programming.

You can use any your favorite Code editor to access the project files here and do any modifications. All your modifications are insistantly reflected on restbird web portal, you don’t need to restart it at all.