coderofsalvation / dpd-swagger-doc

automatically generated apidocs from deployd resources
MIT License
6 stars 2 forks source link

gettings started on windows #1

Open coderofsalvation opened 7 years ago

coderofsalvation commented 7 years ago

Hi Leon, Its a nice work adding swagger to Deployd. Thanks.

I'm trying to install in my windows set up, I don't understand this part below,

Now copy the swagger-resource and symlink the swaggerfolder:

$ cp -R node_modules/dpd-swagger-doc/resource resources/swagger $ cd public && ln -s ../node_modules/dpd-swagger-doc/node_modules/swagger-ui/dist apidoc && cd - The 2nd line , totally no idea. Help?!

Thanks.

coderofsalvation commented 7 years ago

Hi,

it means you should copy swagger-ui/dist/apidoc of to your public folder

Sadly the module is tested only for windows. Could you be so kind to write a small windows-guide here to get it installed (for other users?)

moorthi07 commented 7 years ago

Let me make sure I understand correct (and what I did was..)

  1. copy contents of node_modules/dpd-swagger-doc/resource and create it in 'resources/swagger' - folder. (ie. copied 2 files config.json and get.js)
  2. Then create a symlink 'apidoc' under 'public' folder referencing to a folder '../node_modules/dpd-swagger-doc/node_modules/swagger-ui/dist'

First of all , 'swagger-ui' is not installed under 'dpd-swagger-doc', instead it is installed in main 'node_modules' folder. Strange?! In Windows terminal I tried, mklink /D ../node_modules/swagger-ui/dist apidoc That created a symlink as below

Mode LastWriteTime Length Name


d----l 2/3/2017 11:07 PM apidoc d----- 6/3/2016 1:02 AM app d----- 6/3/2016 3:20 AM css d----- 1/20/2017 11:36 PM dist

But npm start - throws an error,

Error: Cannot find type "EventResource" for resource swagger - when initializing: swagger

Seems this resource should be created from dashboard or Reference to be made type EventResource in code.

moorthi07 commented 7 years ago

I did an uninstall and reinstall dpd-event and dpd-swagger-doc , the 'EventResource' error is gone (problem with dpd-event old install. )

I tried , http://localhost:2404/apidoc/?url=/swagger#!/default

404 Resource no found error now.

kkrishnan90 commented 7 years ago

I'm running through the same issue with the API deployed on AWS. Any updates guys? I'm getting the same 404 error as mentioned by Moorthi.

coderofsalvation commented 7 years ago

have you tried copying node_modules/dpd-swagger-doc/node_modules/swagger-ui/dist to public/apidoc?

and does requesting /swagger return a json?

moorthi07 commented 7 years ago

Great , it works. But need another package and proper copies and folders.

  1. Try these steps
  2. npm install dpd-event dpd-swagger-doc dpd-event-extension
  3. Copy : node_modules/dpd-swagger-doc/resource to resources/swagger
  4. Create a folder in 'public' folder: 'apidoc'
  5. Copy from:

    /node_modules/dpd-swagger-doc/node_modules/swagger-ui/dist to public/apidoc

now try, http://localhost:2403/apidoc/?url=/swagger#!/default

coderofsalvation commented 7 years ago

I've updated the README.md with your instructions (and published to npm). Now there's a linux and a windows-guide.

Awesome thx.

On Thu, May 11, 2017 at 12:18 PM, PV notifications@github.com wrote:

Great , it works. But need another package and proper copies and folders.

  1. Try these steps
  2. npm install dpd-event dpd-swagger-doc dpd-event-extension
  3. Copy : node_modules/dpd-swagger-doc/resource to resources/swagger
  4. Create a folder in 'public' folder: 'apidoc'
  5. Copy from:

/node_modules/dpd-swagger-doc/node_modules/swagger-ui/dist to public/apidoc

now try, http://localhost:2403/apidoc/?url=/swagger#!/default

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/coderofsalvation/dpd-swagger-doc/issues/1#issuecomment-300747485, or mute the thread https://github.com/notifications/unsubscribe-auth/AAK_ZJBTp4Dki83N5YeN3VJXy7Raq4VWks5r4uCIgaJpZM4L3Uk1 .

-- /WEBSITE 2wa.isvery.ninja /MOBILE +31 6 13499604 /LOCATION Netherlands, Drachten. Hongarije, Budapest. /COMPANYNR. 08124656 /TAGS Rapid Prototyping of ideas/concepts using JavaScript, Node.js, OpenSource. Growth-hacking partnerships, lead scraping partnerships.

kkrishnan90 commented 7 years ago

I still can't get it to work. It says the following error. Is there any additional package that I need to install from npm ? By the way, I'm testing it on my Macbook. This is something related to the window used inside the index.html inside the swagger-ui ? I'm still not able to figure it out. Any help ?

Here's the error message ,

Error loading module node_modules/brace
ReferenceError: window is not defined
    at /Users/expertonetechnologies/Documents/Personal/MyProf/myp/node_modules/brace/index.js:18655:26
    at _acequire (/Users/expertonetechnologies/Documents/Personal/MyProf/myp/node_modules/brace/index.js:88:37)
    at Object.acequire (/Users/expertonetechnologies/Documents/Personal/MyProf/myp/node_modules/brace/index.js:93:26)
    at /Users/expertonetechnologies/Documents/Personal/MyProf/myp/node_modules/brace/index.js:18653:21
    at Object.<anonymous> (/Users/expertonetechnologies/Documents/Personal/MyProf/myp/node_modules/brace/index.js:18660:15)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at /usr/local/lib/node_modules/deployd/lib/type-loader.js:22:30
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickDomainCallback (internal/process/next_tick.js:128:9)
kkrishnan90 commented 7 years ago

Great ! I got it working by doing following (nasty hack though coz all I need is to create a documentation after all) on my Macbook. May be it might help someone in future here .. 1.npm install dpd-event dpd-swagger-doc dpd-event-extension 2.Copy : node_modules/dpd-swagger-doc/resource to resources/swagger 3.Create a folder in 'public' folder: 'apidoc' 4.Copy from: /node_modules/dpd-swagger-doc/node_modules/swagger-ui/dist to public/apidoc

Error loading module node_modules/brace ReferenceError: window is not defined

Here it is, after performing the above steps. Follow these on the Mac when you get the above error 1.npm uninstall brace 2.npm uninstall fbjs 3.npm uninstall lodash-es

Tada.....! You got it ! Visit the below link http://localhost:2403/apidoc/?url=/swagger#!/default

P.S : It might throw some error on the console for certain functions and headers being missed. But as far as I tested it , it won't create a much of havoc on the documentation part. Hope this helps somebody !

coderofsalvation commented 7 years ago

thx! added it to the README.md & published new version.

On Thu, May 11, 2017 at 2:49 PM, kkrishnan90 notifications@github.com wrote:

Great ! I got it working by doing following (nasty hack though coz all I need is to create a documentation after all) on my Macbook. May be it might help someone in future here .. 1.npm install dpd-event dpd-swagger-doc dpd-event-extension 2.Copy : node_modules/dpd-swagger-doc/resource to resources/swagger 3.Create a folder in 'public' folder: 'apidoc' 4.Copy from: /node_modules/dpd-swagger-doc/node_modules/swagger-ui/dist to public/apidoc

Here it is after performing the above steps follow these on the Mac when you get the above error 1.npm uninstall brace 2.npm uninstall fbjs 3.npm uninstall lodash-es

Tada.....! You got it ! Visit the below link http://localhost:2403/apidoc/?url=/swagger#!/default

P.S : It might throw some error on the console for certain functions and headers being missed. But as far as I tested it , it won't create a much of havoc on the documentation part. Hope this helps somebody !

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/coderofsalvation/dpd-swagger-doc/issues/1#issuecomment-300778902, or mute the thread https://github.com/notifications/unsubscribe-auth/AAK_ZAHY-w3lhabsGz7ywiyl6G3nOPEnks5r4wP1gaJpZM4L3Uk1 .

-- /WEBSITE 2wa.isvery.ninja /MOBILE +31 6 13499604 /LOCATION Netherlands, Drachten. Hongarije, Budapest. /COMPANYNR. 08124656 /TAGS Rapid Prototyping of ideas/concepts using JavaScript, Node.js, OpenSource. Growth-hacking partnerships, lead scraping partnerships.