Skip to content
This repository has been archived by the owner on Dec 15, 2019. It is now read-only.

Commit

Permalink
swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
evantahler committed Nov 28, 2016
1 parent c4c0815 commit 273157a
Show file tree
Hide file tree
Showing 25 changed files with 67 additions and 3,631 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ npm-debug.log
.DS_Store
.env
dump.rdb
public/js/actionhero
public/javascript/actionheroClient*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Copy the `.env.example` file to `.env` and fill in the data you will need to boo
- There is a separate navigation bar depending on if you are logged in or not, but there are some pages both types of users have access to. (this is in `./public/sections`)
- `./public/index.html` is the only entry-point into the project. All other pages are loaded in dynamically.
- we use the `angular-route` plug-in to use ajax-y static URLs
- `./public/js/app.js` is where the main angular module is configured, and then `./public/js/controlers` contain the logic for each page.
- `./public/javascript/app.js` is where the main angular module is configured, and then `./public/javascript/controllers` contain the logic for each page.

#### app.js
- we have a collection of routes ($rootScope.routes) and define where they can be loaded from, the page title, and if this page requires a logged-in user. If a logged-out user lands on this URL, they will be rediredted to the home page (defined in `pageController`)
Expand Down
1 change: 1 addition & 0 deletions actions/plugins/ah-swagger-plugin.link
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
actions
2 changes: 2 additions & 0 deletions config/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ exports.default = {
missingParamChecks: [null, '', undefined],
// The default filetype to server when a user requests a directory
directoryFileType: 'index.html',
// What log-level should we use for file requests?
fileRequestLogLevel: 'debug',
// The default priority level given to middleware of all types (action, connection, and say)
defaultMiddlewarePriority: 100,
// Which channel to use on redis pub/sub for RPC communication
Expand Down
6 changes: 3 additions & 3 deletions config/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ exports.default = {
get: [
{ path: '/user', action: 'user:view' },
{ path: '/docs', action: 'showDocumentation' },
{ path: '/status', action: 'status' }
{ path: '/status', action: 'status' },
{ path: '/swagger', action: 'swagger' }
],

post: [
Expand All @@ -19,8 +20,7 @@ exports.default = {
],

delete: [
{ path: '/session', action: 'session:destroy' },
{ path: '/registry', action: 'registry:destroy' }
{ path: '/session', action: 'session:destroy' }
]

}
Expand Down
2 changes: 1 addition & 1 deletion config/servers/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exports.default = {
clientUrl: 'window.location.origin',
// Directory to render client-side JS.
// Path should start with "/" and will be built starting from api.config..general.paths.public
clientJsPath: 'js/actionhero/',
clientJsPath: 'javascript',
// the name of the client-side JS file to render. Both `.js` and `.min.js` versions will be created
// do not include the file exension
// set to `undefined` to not render the client-side JS on boot
Expand Down
30 changes: 30 additions & 0 deletions config/swagger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
exports['default'] = {
swagger: function (api) {
return {
// Should be changed to hit www.yourserver.com. If this is null, defaults to ip:port from
// internal values or from hostOverride and portOverride.
baseUrl: '127.0.0.1:8080',
// Specify routes that don't need to be displayed
ignoreRoutes: [ '/swagger' ],
// Specify how routes are grouped
routeTags: {
'server': [ 'docs', 'status' ],
'user': [ 'user' ],
'session': [ 'session' ]
},
// Generate documentation for simple actions specified by action-name
documentSimpleRoutes: false,
// Generate documentation for actions specified under config/routes.js
documentConfigRoutes: true,
// Set true if you want to organize actions by version
groupByVersionTag: false,
// For simple routes, groups all actions under a single category
groupBySimpleActionTag: true,
// In some cases where actionhero network topology needs to point elsewhere. If null, uses
// api.config.swagger.baseUrl
hostOverride: null,
// Same as above, if null uses the internal value set in config/server/web.js
portOverride: null
}
}
}
1 change: 1 addition & 0 deletions initializers/plugins/ah-swagger-plugin.link
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
initializers
4 changes: 3 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,7 @@
"*** ActionHero Stopped ***": "*** ActionHero Stopped ***",
"loading the testServer": "loading the testServer",
"*** ActionHero Started ***": "*** ActionHero Started ***",
"%s is a required parameter for this action": "%s is a required parameter for this action"
"%s is a required parameter for this action": "%s is a required parameter for this action",
"unknown action or invalid apiVersion": "unknown action or invalid apiVersion",
"both room and message are required": "both room and message are required"
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"dependencies": {
"actionhero": "^16.0.0",
"ah-resque-ui": "0.2.0",
"ah-swagger-plugin": "^1.0.0",
"bcrypt": "^0.8.5",
"fakeredis": "^1.0.3",
"ioredis": "^2.3.0",
Expand Down
28 changes: 14 additions & 14 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@

<!-- Angular -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="/js/bootstrap/bootstrap.min.js"></script>
<script src="/js/angular/angular.min.js"></script>
<script src="/js/angular/angular-route.min.js"></script>
<script src="/js/actionhero/actionheroClient.min.js"></script>
<script src="/javascript/bootstrap/bootstrap.min.js"></script>
<script src="/javascript/angular/angular.min.js"></script>
<script src="/javascript/angular/angular-route.min.js"></script>
<script src="/javascript/actionhero/actionheroClient.min.js"></script>

<!-- App -->
<script src="/js/app/app.js"></script>
<script src="/js/app/controllers/session.js"></script>
<script src="/js/app/controllers/about.js"></script>
<script src="/js/app/controllers/dashboard.js"></script>
<script src="/js/app/controllers/user.js"></script>
<script src="/js/app/controllers/chat.js"></script>
<script src="/javascript/app/app.js"></script>
<script src="/javascript/app/controllers/session.js"></script>
<script src="/javascript/app/controllers/about.js"></script>
<script src="/javascript/app/controllers/dashboard.js"></script>
<script src="/javascript/app/controllers/user.js"></script>
<script src="/javascript/app/controllers/chat.js"></script>

</head>

<body ng-controller="pageController">

<header id="nav-container" class="container">
<div ng-if="$root.user" ng-include="'sections/nav-logged-in.html'"></div>
<div ng-if="!$root.user" ng-include="'sections/nav-logged-out.html'"></div>
<div ng-if="$root.user" ng-include="'sections/nav-logged-in.html'"></div>
<div ng-if="!$root.user" ng-include="'sections/nav-logged-out.html'"></div>
</header>

<div class="container">
Expand All @@ -55,4 +55,4 @@
</footer>

</body>
</html>
</html>
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 273157a

Please sign in to comment.