Skip to content

Commit

Permalink
Update to use Drafter.
Browse files Browse the repository at this point in the history
Updates to README and CHANGELOG.
  • Loading branch information
yakovkhalinsky committed Feb 9, 2017
1 parent 97c8e91 commit 9f91708
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 18 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
### (1.0.2.) February 10, 2017; Excellent logging edition

#### Changes

* Updated to use latest version of Drafter, which falls back to Drafter.js
* Log request matching process for better problem diagnosis [link](https://github.com/Aconex/drakov/pull/154)

#### Thanks

A quick thank you to all the people in the community who contributed code to this release!

* Radion Chernyakov https://github.com/nixololo


### (1.0.1.) July 6, 2016; Speed Racer Edition

#### Changes
Expand Down
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,27 @@ We have setup a google group to assist with the answering of questions any users
It can be found at [https://groups.google.com/forum/?hl=en#!forum/drakov-api-server](https://groups.google.com/forum/?hl=en#!forum/drakov-api-server)


## Notes on the Node.js compatibility

Since version 1.0.2, a version of the Drafter package is being used, which attempts to install the version with C bindings (faster), but falls back if compilation of this package fails to Drafter.js.

Currently this package doesn't install on Node.js version 7+. All versions below and including Node.js 6.x will work fine.


## MSON Support via Attribute elements

Since version 0.1.12 MSON support is now provided.


## Logging to assist with debugging request matching

Drakov provide some logging in the following situations:

- When request's path does not match any documented endpoints
- When request's headers does not match headers schema
- When request's body does not match body schema (corresponding to request's content-type)


## Installation instructions

`npm install -g drakov`
Expand All @@ -45,7 +61,7 @@ Since version 0.1.12 MSON support is now provided.

**Important**

This mode of operation will load your configuration from a Javascript file that must export an object of arguments as
This mode of operation will load your configuration from a Javascript file that must export an object of arguments as
supported in the [arguments module](https://github.com/Aconex/drakov/blob/master/lib/arguments/arguments.js).

All command line arguments aside from `--config` will be ignored, and the defaults will be merged in.
Expand Down Expand Up @@ -112,7 +128,7 @@ By default a CORS header is sent, you can disable it with the --disableCORS swit

## Automatic response to OPTIONS requests

When you run server for testing API on different port than your app it's handy to allow cross origin resource sharing (CORS).
When you run server for testing API on different port than your app it's handy to allow cross origin resource sharing (CORS).
For this to work you need also to listen on every route for OPTIONS requests.

`drakov -f "../com/foo/contracts/*.md" --autoOptions`
Expand Down Expand Up @@ -164,7 +180,7 @@ Drakov includes many headers by default: `Origin, X-Requested-With, Content-Type
## Using as a Node.js module

var drakov = require('drakov');

var argv = {
sourceFiles: 'path/to/files/**.md',
serverPort: 3000,
Expand All @@ -180,7 +196,7 @@ Drakov includes many headers by default: `Origin, X-Requested-With, Content-Type
delay: 2000,
method: ['DELETE','OPTIONS']
};

drakov.run(argv, function(){
// started Drakov
drakov.stop(function() {
Expand Down
2 changes: 1 addition & 1 deletion lib/parse/blueprint.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var fs = require('fs');
var drafter = require('drafter.js');
var drafter = require('drafter');
var _ = require('lodash');
var urlParser = require('./url');
var parseParameters = require('./parameters');
Expand Down
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,25 @@
},
"license": "MIT",
"dependencies": {
"async": "^1.4.2",
"chokidar": "^1.4.3",
"async": "^2.1.4",
"chokidar": "^1.6.1",
"colors": "^1.1.0",
"drafter.js": "^2.4.3",
"express": "^4.13.4",
"glob": "^7.0.3",
"drafter": "^1.2.0",
"express": "^4.14.1",
"glob": "^7.1.1",
"jade": "^1.11.0",
"lodash": "^4.6.1",
"path-to-regexp": "^1.0.3",
"qs": "^6.1.0",
"lodash": "^4.17.4",
"path-to-regexp": "^1.7.0",
"qs": "^6.3.0",
"tv4": "^1.1.9",
"yargs": "^4.2.0"
"yargs": "^6.6.0"
},
"devDependencies": {
"grunt": "^0.4.5",
"grunt": "^1.0.1",
"grunt-blueprint-validator": "^3.1.0",
"grunt-cli": "^0.1.13",
"grunt-contrib-jshint": "^1.0.0",
"grunt-cli": "^1.2.0",
"grunt-contrib-jshint": "^1.1.0",
"grunt-simple-mocha": "^0.4.0",
"supertest": "^1.2.0"
"supertest": "^3.0.0"
}
}

0 comments on commit 9f91708

Please sign in to comment.