Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/m-esm/node-multi-branch
It runs an instance per branch of your node project repository. and let you access different branches by setting a header key
https://github.com/m-esm/node-multi-branch
branch git node nodejs reverse-proxy stage staging
Last synced: 29 days ago
JSON representation
It runs an instance per branch of your node project repository. and let you access different branches by setting a header key
- Host: GitHub
- URL: https://github.com/m-esm/node-multi-branch
- Owner: m-esm
- Created: 2019-12-04T20:22:13.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-11T16:00:46.000Z (almost 2 years ago)
- Last Synced: 2024-04-14T04:45:04.096Z (7 months ago)
- Topics: branch, git, node, nodejs, reverse-proxy, stage, staging
- Language: TypeScript
- Size: 449 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
```___
/\ \ _____
|::\ \ /::\ \
|:|:\ \ /:/\:\ \
__|:|\:\ \ /:/ /::\__\
/::::|_\:\__\ /:/_/:/\:|__|
\:\~~\ \/__/ \:\/:/ /:/ /
\:\ \ \::/_/:/ /
\:\ \ \:\/:/ /
\:\__\ \::/ /
\/__/ \/__/
```### Multi Branch
did you ever want to run more than one branch of your code at a time? and have the ability to switch between them by simply setting an HTTP header key named 'branch'
To easily use multi-branch install [ModHeader extension for chrome](https://chrome.google.com/webstore/detail/modheader/idgpnmonknjnojddfkpgkljpfnnfcklj?hl=en). you can set the "branch" header key with this tool.
### Installation
1. install the package
```
npm install multi-branch --save
```2. add this command to your existing npm start command
```
multi-branch --only=staging --branches=master,stage --default-branch=stage &&
```example (package.json):
```json
{
"name": ...,
"version": ...,
"repository": ...,
"author": ...,
"license": ...,
"scripts": {
"start": "multi-branch --only=staging --branches=master,stage --default-branch=stage && node app.js"
},
"dependencies": {
...
}
}
```**arguments:**
```
-p,--port to specify port MultiBranch will listen to--port-env to specify project port env name
--default-branch to specify default branch for reverse proxy
--only to specify multi branch run env
-b,--branch comma separated branch names to run
-h,--help to view help
```### Maintenance routes
#### [GET] /multi-branch
this route will be available at top of reverse proxy server and shows you information about branch processes
#### [GET] /multi-branch/stats
get last 100 process usage stat
#### [GET] /multi-branch/logs
![Multi-Branch logs](https://raw.githubusercontent.com/m-esm/node-multi-branch/master/screenshot-logs.png "Multi-Branch logs")