Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ZipKin and Swagger #7

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
add status
yanglei99 committed Jan 15, 2016

Partially verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
commit 739627661110345d1d324374c7e4bda31aaf8a5a
2 changes: 1 addition & 1 deletion acmeairhttp/index.js
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ module.exports = function (settings) {
var module = {};
var http = require('http')

var contextRoot = settings.authContextRoot || "/acmeair-auth-service/rest/api"
var contextRoot = settings.authContextRoot
var location = process.env.AUTH_SERVICE;

var hostAndPort = location.split(":");
2 changes: 1 addition & 1 deletion authservice_app.js
Original file line number Diff line number Diff line change
@@ -85,11 +85,11 @@ var router = express.Router();

router.post('/byuserid/:user', createToken);
router.get('/:tokenid', validateToken);
router.get('/status', checkStatus);
router.delete('/:tokenid', invalidateToken);

// REGISTER OUR ROUTES so that all of routes will have prefix
app.use(settings.authContextRoot+'/authtoken', router);
app.get(settings.authContextRoot+'/checkstatus', checkStatus);

var initialized = false;
var serverStarted = false;
37 changes: 33 additions & 4 deletions dist/acmeair/swagger-auth.json
Original file line number Diff line number Diff line change
@@ -14,18 +14,47 @@
}
},
"host": "localhost",
"basePath": "/rest/api/auth-service/authtoken",
"basePath": "/rest/api/auth-service",
"tags": [
{
"name": "auth-service",
"description": "authentication"
},
{
"name": "status",
"description": "status"
}
],
"schemes": [
"http"
],
"paths": {
"/byuserid/{userId}":{
"/checkstatus":{
"get":{
"tags": [
"status"
],
"summary": "Check status",
"description": "Check status",
"operationId": "checkStatus",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
],
"responses": {
"200": {
"description": "successful operation."
}
},
"security": [
]
}
},
"/authtoken/byuserid/{userId}":{
"post":{
"tags": [
"auth-service"
@@ -67,7 +96,7 @@

}
},
"/{tokenId}":{
"/authtoken/{tokenId}":{
"get":{
"tags": [
"auth-service"
@@ -108,7 +137,7 @@
]
}
},
"/{token}":{
"/authtoken/{token}":{
"delete":{
"tags": [
"auth-service"
29 changes: 29 additions & 0 deletions dist/acmeair/swagger.json
Original file line number Diff line number Diff line change
@@ -39,12 +39,41 @@
{
"name": "config",
"description": "Operations to show configuration"
},
{
"name": "status",
"description": "status"
}
],
"schemes": [
"http"
],
"paths": {
"/checkstatus":{
"get":{
"tags": [
"status"
],
"summary": "Check status",
"description": "Check status",
"operationId": "checkStatus",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
],
"responses": {
"200": {
"description": "successful operation."
}
},
"security": [
]
}
},
"/login": {
"post": {
"tags": [