Comments (5)
I think I just figured it out, please tell me if this is a good way to do this or if I should be doing something else.
After debugging through it, and also looking at the swagger tools project, I saw that I could do the following in my app.js (which was generated using a127):
a127.init(function(config) {
app.use(a127.middleware(config));
app.use(config['a127.magic'].swaggerTools.swaggerUi());
app.listen(process.env.PORT || 10010);
console.log('try this:\ncurl http://127.0.0.1:10010/hello?name=Scott');
});
Is this the preferred way to do this?
Thanks,
...Ed
from a127-documentation.
I honestly don't know if there is a preferred way to do this... I do know there is a plan to make Swagger Editor be able to provide the capabilities of Swagger UI (and more) and expose that functionality via configuration. In the meantime, your solution can work... I just can't guarantee it will continue to do so as it relies on implementation details in a127-magic.
from a127-documentation.
OK, thanks Scott. It might be nice if the swagger tools was exposed directly off the config or some other way we could rely on. There is a lot of nice stuff in there that would be great to get at in a reliable way. I would think it would always be there because I think you are already using it for the validation.
Thanks again Scott for the quick reply, it helps a lot as I wrap my head around this stuff.
from a127-documentation.
True, swagger-tools is likely to always be there. My point is just that since we encapsulate it and don't document access to it, I would consider it "unsupported". What functionality are you interested in accessing from swagger-tools that we don't already expose?
from a127-documentation.
Good point, I guess the things I would really want out of the swagger tools is a way to view the swagger UI and to be able to get the swagger doc in json so that it could be potentially displayed in a dev portal.
For this, maybe if there was an easy way to setup the middleware to optionally expose a /doc and /api-docs route and hide the fact that it comes from the swagger tools ... that would definitely work for me.
In looking further at the swagger tools, I agree that exposig all of that is probably not a great idea since it has way more stuff than I think anyone would need outside the internals.
from a127-documentation.
Related Issues (15)
- question: Having trouble getting my app to use the customerKey for the product rather than the remote proxy when deployed to Apigee .... HOT 4
- JSON is escaped when ran in mock mode
- Validate response from a controller
- usergrid - failed to start
- Not able to login into usergrid portal
- tar.Extract is not a function HOT 2
- config/xx.yaml not loading, key/variable names returns undefined? HOT 1
- Add screenshots and more detail on add analytics page
- Add 'try this' type content to OAuth page to confirm it works
- Swagger Editor for 127 README HOT 1
- Vimeo links are malformed HOT 2
- Permissions issue while installing using npm HOT 2
- "Try This" broken for hello world HOT 1
- Invalid/corrupt Usergrid launcher jar file HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from a127-documentation.