Aconex / drakov

Mock Server that implements the API Blueprint specification
MIT License
481 stars 115 forks source link

Discover option does not work #168

Closed ashee closed 7 years ago

ashee commented 7 years ago

When I invoke drakov with --discover, the /discover endpoint is not created.

$ drakov -f api.md --discover
[INFO] No configuration files found
[INFO] Loading configuration from CLI
   DRAKOV STARTED
[LOG] Setup Route: GET /stream/0/posts/:post_id Retrieve a Post
[LOG] Setup Route: DELETE /stream/0/posts/:post_id Delete a Post
[LOG] Setup Route: POST /stream/0/posts Create a Post
[LOG] Setup Route: GET /stream/0/posts Retrieve all Posts
[LOG] Setup Route: POST /stream/0/posts/:post_id/star Star a Post
[LOG] Setup Route: DELETE /stream/0/posts/:post_id/star Unstar a Post
   Drakov 1.0.4      Listening on port 3000

$ curl http://localhost:3000/discover
Endpoint not found

My setup

$ nvm current
v6.11.0

$ npm info drakov

{ name: 'drakov',
  description: 'Mock server that implements the API Blueprint specification',
  'dist-tags': { latest: '1.0.4' },
  versions: 
   [ '0.0.1',
     '0.0.2',
     '0.0.3',
     '0.0.4',
     '0.0.5',
     '0.0.6',
     '0.0.7',
     '0.0.8',
     '0.0.9',
     '0.0.10',
     '0.0.11',
     '0.0.12',
     '0.0.13',
     '0.0.14',
     '0.0.15',
     '0.1.0',
     '0.1.1',
     '0.1.2',
     '0.1.3',
     '0.1.4',
     '0.1.5',
     '0.1.6',
     '0.1.7',
     '0.1.8',
     '0.1.9',
     '0.1.10',
     '0.1.11',
     '0.1.12',
     '0.1.13',
     '0.1.14',
     '0.1.15',
     '0.1.16',
     '0.1.17',
     '0.2.0',
     '0.2.1',
     '0.2.2',
     '1.0.0',
     '1.0.1',
     '1.0.2',
     '1.0.3',
     '1.0.4' ],
  maintainers: 
   [ 'russianator <yakov@ninebyt.es>',
     'mobz <ben@mobz.org>',
     'marcelogo <marcelo.mgo@gmail.com>' ],
  time: 
   { modified: '2017-04-22T13:52:12.537Z',
     created: '2014-08-25T00:48:32.569Z',
     '0.0.1': '2014-08-25T00:48:32.569Z',
     '0.0.2': '2014-08-25T07:10:40.051Z',
     '0.0.3': '2014-08-27T00:35:31.691Z',
     '0.0.4': '2014-08-27T04:01:36.147Z',
     '0.0.5': '2014-09-05T12:22:10.715Z',
     '0.0.6': '2014-09-05T12:38:49.737Z',
     '0.0.7': '2014-10-08T23:58:53.494Z',
     '0.0.8': '2014-10-10T05:42:15.456Z',
     '0.0.9': '2015-01-17T01:41:33.675Z',
     '0.0.10': '2015-01-20T02:47:13.484Z',
     '0.0.11': '2015-01-27T22:03:55.809Z',
     '0.0.12': '2015-01-27T23:05:04.806Z',
     '0.0.13': '2015-01-28T06:59:02.607Z',
     '0.0.14': '2015-01-28T08:08:40.808Z',
     '0.0.15': '2015-02-05T20:20:11.046Z',
     '0.1.0': '2015-02-13T09:29:45.005Z',
     '0.1.1': '2015-02-18T23:16:09.334Z',
     '0.1.2': '2015-02-27T11:21:48.525Z',
     '0.1.3': '2015-04-08T07:46:27.742Z',
     '0.1.4': '2015-04-27T07:15:16.364Z',
     '0.1.5': '2015-05-07T04:04:31.150Z',
     '0.1.6': '2015-05-16T05:54:04.578Z',
     '0.1.7': '2015-05-19T05:40:56.898Z',
     '0.1.8': '2015-07-02T12:32:39.771Z',
     '0.1.9': '2015-07-20T22:43:07.003Z',
     '0.1.10': '2015-07-21T12:59:57.818Z',
     '0.1.11': '2015-07-27T10:21:46.184Z',
     '0.1.12': '2015-08-27T09:45:04.811Z',
     '0.1.13': '2015-10-05T09:59:42.190Z',
     '0.1.14': '2015-10-09T13:30:59.974Z',
     '0.1.15': '2015-10-20T04:24:29.560Z',
     '0.1.16': '2015-10-21T00:12:34.603Z',
     '0.1.17': '2015-12-28T23:42:36.413Z',
     '0.2.0': '2016-01-07T10:54:47.257Z',
     '0.2.1': '2016-02-01T20:41:01.808Z',
     '0.2.2': '2016-03-09T10:33:19.004Z',
     '1.0.0': '2016-03-12T11:40:34.313Z',
     '1.0.1': '2016-07-05T19:13:26.849Z',
     '1.0.2': '2017-02-09T22:05:09.585Z',
     '1.0.3': '2017-03-20T09:31:14.634Z',
     '1.0.4': '2017-04-22T13:52:12.537Z' },
  homepage: 'https://github.com/aconex/drakov',
  repository: { type: 'git', url: 'git+https://github.com/Aconex/drakov.git' },
  author: 'Yakov Khalinsky <ykhalinsky@aconex.com>',
  bugs: { url: 'https://github.com/aconex/drakov/issues' },
  license: 'MIT',
  readmeFilename: 'README.md',
  users: 
   { frankg: true,
     xthiago: true,
     gdaleson: true,
     mehrantm: true,
     terenc3: true,
     'thomas.miele': true,
     crewmoss: true,
     joakimbeng: true },
  version: '1.0.4',
  main: './index.js',
  bin: { drakov: 'drakov' },
  scripts: { test: 'grunt' },
  engines: { node: '>= 0.12' },
  dependencies: 
   { async: '^2.1.4',
     chokidar: '^1.6.1',
     colors: '^1.1.0',
     drafter: '^1.2.0',
     express: '^4.14.1',
     glob: '^7.1.1',
     jade: '^1.11.0',
     lodash: '^4.17.4',
     'path-to-regexp': '^1.7.0',
     qs: '^6.3.0',
     tv4: '^1.1.9',
     yargs: '^6.6.0' },
  devDependencies: 
   { grunt: '^0.4.5',
     'grunt-blueprint-validator': '^3.1.0',
     'grunt-cli': '^1.2.0',
     'grunt-contrib-jshint': '^1.1.0',
     'grunt-simple-mocha': '^0.4.0',
     supertest: '^3.0.0' },
  gitHead: '1c1c3fd890cff72d7a9cea5c1ceeb18ca38c67c3',
  dist: 
   { shasum: 'ed0eb4bccc8ddf8c97c0eb019d5da835c8fa845b',
     tarball: 'https://registry.npmjs.org/drakov/-/drakov-1.0.4.tgz' },
  directories: {} }

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.12.5
BuildVersion:   16F73
ashee commented 7 years ago

Silly mistake, the endpoint is /drakov not /discover. Closing it.