aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sra-api
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-08-08 04:50:56 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-08-08 04:50:56 +0800
commit57a44291233548da9785aec3cde92171342c9eb3 (patch)
tree90d19c24a8e07b3ee0b4835c3067dac9aba82617 /packages/sra-api
parent3b542bf356f14e7bfd5bbd740d2df55ff64e1309 (diff)
downloaddexon-sol-tools-57a44291233548da9785aec3cde92171342c9eb3.tar
dexon-sol-tools-57a44291233548da9785aec3cde92171342c9eb3.tar.gz
dexon-sol-tools-57a44291233548da9785aec3cde92171342c9eb3.tar.bz2
dexon-sol-tools-57a44291233548da9785aec3cde92171342c9eb3.tar.lz
dexon-sol-tools-57a44291233548da9785aec3cde92171342c9eb3.tar.xz
dexon-sol-tools-57a44291233548da9785aec3cde92171342c9eb3.tar.zst
dexon-sol-tools-57a44291233548da9785aec3cde92171342c9eb3.zip
Add discharge config and deploy
Diffstat (limited to 'packages/sra-api')
-rw-r--r--packages/sra-api/.discharge.json13
-rw-r--r--packages/sra-api/README.md20
-rw-r--r--packages/sra-api/package.json6
3 files changed, 36 insertions, 3 deletions
diff --git a/packages/sra-api/.discharge.json b/packages/sra-api/.discharge.json
new file mode 100644
index 000000000..ddb76d50d
--- /dev/null
+++ b/packages/sra-api/.discharge.json
@@ -0,0 +1,13 @@
+{
+ "domain": "sra-api.com",
+ "build_command": "yarn build-site",
+ "upload_directory": "public",
+ "index_key": "index.html",
+ "error_key": "index.html",
+ "trailing_slashes": true,
+ "cache": 3600,
+ "aws_profile": "default",
+ "aws_region": "us-east-1",
+ "cdn": false,
+ "dns_configured": true
+}
diff --git a/packages/sra-api/README.md b/packages/sra-api/README.md
index 552e37eeb..23eefe7d8 100644
--- a/packages/sra-api/README.md
+++ b/packages/sra-api/README.md
@@ -4,6 +4,8 @@ Contains the Standard Relayer API [OpenAPI Spec](https://github.com/OAI/OpenAPI-
The package distributes both a javascript object version and a json version.
+A deployed [ReDoc](https://github.com/Rebilly/ReDoc) static site with the API can be found here http://sra-api.com.s3-website-us-east-1.amazonaws.com/.
+
## Usage
```
@@ -21,7 +23,7 @@ yarn install
You can start a development server that will serve a [ReDoc](https://github.com/Rebilly/ReDoc) documentation instance. It uses the `api.json` file from `lib/` (you must have built at least once with `yarn build` or `yarn build-json`) that is based on the `api` object exported from `src`.
```
-yarn develop
+yarn watch_without_deps
```
The process will watch for changes, but will not hot-reload so you must refresh the page to see the changes.
@@ -60,6 +62,22 @@ Or continuously rebuild on change:
PKG=@0xproject/sra-api yarn watch
```
+### Static Site
+
+We also [host a static HTML version of the docs on S3](http://sra-api.com.s3-website-us-east-1.amazonaws.com/) for easy sharing.
+
+To build the website run
+
+```
+yarn build-site
+```
+
+To build and deploy the site run
+
+```
+yarn deploy-site
+```
+
### Clean
```bash
diff --git a/packages/sra-api/package.json b/packages/sra-api/package.json
index b7bcd588b..4e0fb1637 100644
--- a/packages/sra-api/package.json
+++ b/packages/sra-api/package.json
@@ -19,9 +19,10 @@
"run_mocha": "mocha lib/test/**/*_test.js --exit",
"clean": "shx rm -rf lib",
"build": "tsc && yarn build-json",
- "build-site": "yarn build-json && redoc-cli bundle lib/api.json --output public/index.html",
+ "build-site": "yarn build && redoc-cli bundle lib/api.json --output public/index.html",
"build-json": "ts-node scripts/buildJson.ts",
- "build-json:watch": "chokidar 'src/**/*' -c 'yarn build-json' "
+ "build-json:watch": "chokidar 'src/**/*' -c 'yarn build-json' ",
+ "deploy-site": "discharge deploy"
},
"repository": {
"type": "git",
@@ -44,6 +45,7 @@
"chai": "^4.0.1",
"chokidar-cli": "^1.2.0",
"dirty-chai": "^2.0.1",
+ "discharge": "^0.7.1",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.3",
"nyc": "^11.0.1",