This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed to use hospitalrun-server-routes
- Loading branch information
Showing
8 changed files
with
38 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
var config = { | ||
couch_db_server: 'localhost', | ||
couch_db_port: '5984', | ||
couch_db_use_ssl: false, | ||
couch_db_changes_since: 'now', | ||
couch_admin_user: 'couchadmin', | ||
couch_admin_password: 'test', | ||
google_client_id: 'FOR GOOGLE SSO; GOOGLE CLIENT ID GOES HERE', | ||
google_client_secret: 'FOR GOOGLE SSO; GOOGLE CLIENT SECRET GOES HERE', | ||
server_port: '3000', | ||
couchDbServer: 'localhost', | ||
couchDbPort: '5984', | ||
couchDbUseSsl: false, | ||
couchDbChangesSince: 'now', | ||
couchAdminUser: 'couchadmin', | ||
couchAdminPassword: 'test', | ||
googleClientId: 'FOR GOOGLE SSO; GOOGLE CLIENT ID GOES HERE', | ||
googleClientSecret: 'FOR GOOGLE SSO; GOOGLE CLIENT SECRET GOES HERE', | ||
serverPort: '4200', | ||
server: 'localhost', | ||
use_ssl: false | ||
useSSL: false | ||
}; | ||
|
||
config.couch_credentials = function() { | ||
if (config.couch_admin_user && config.couch_admin_password) { | ||
return config.couch_admin_user + ':' + config.couch_admin_password + '@'; | ||
config.couchCredentials = function() { | ||
if (config.couchAdminUser && config.couchAdminPassword) { | ||
return config.couchAdminUser + ':' + config.couchAdminPassword + '@'; | ||
} else { | ||
return ''; | ||
} | ||
}; | ||
|
||
config.get_protocol = function(is_ssl) { | ||
return 'http' + (is_ssl ? 's' : '') + '://'; | ||
config.getProtocol = function(isSSL) { | ||
return 'http' + (isSSL ? 's' : '') + '://'; | ||
}; | ||
|
||
config.server_url = config.get_protocol(config.use_ssl) + config.server; | ||
if (config.server_port) { | ||
config.server_url += ':' + config.server_port; | ||
config.serverURL = config.getProtocol(config.useSSL) + config.server; | ||
if (config.serverPort) { | ||
config.serverURL += ':' + config.serverPort; | ||
} | ||
|
||
config.couch_db_url = config.get_protocol(config.couch_db_use_ssl) + config.couch_db_server + ':' + config.couch_db_port; | ||
config.couch_auth_db_url = config.get_protocol(config.couch_db_use_ssl) + config.couch_credentials() + config.couch_db_server + ':' + config.couch_db_port; | ||
//config.search_url = 'http://localhost:9200'; ELASTIC SEARCH URL (OPTIONAL) | ||
config.couchDbURL = config.getProtocol(config.couchDbUseSsl) + config.couchDbServer + ':' + config.couchDbPort; | ||
config.couchAuthDbURL = config.getProtocol(config.couchDbUseSsl) + config.couchCredentials() + config.couchDbServer + ':' + config.couchDbPort; | ||
// config.searchURL = 'http://localhost:9200'; ELASTIC SEARCH URL (OPTIONAL) | ||
module.exports = config; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,7 @@ | ||
// To use it create some files under `routes/` | ||
// e.g. `server/routes/ember-hamsters.js` | ||
// | ||
// module.exports = function(app) { | ||
// app.get('/ember-hamsters', function(req, res) { | ||
// res.send('hello'); | ||
// }); | ||
// }; | ||
|
||
var bodyParser = require('body-parser'); | ||
var globSync = require('glob').sync; | ||
var routes = globSync('./routes/**/*.js', { cwd: __dirname }).map(require); | ||
var config = require('./config.js'); | ||
var serverRoutes = require('hospitalrun-server-routes'); | ||
|
||
module.exports = function(app) { | ||
routes.forEach(function(route) { | ||
route(app); | ||
}); | ||
config.emberCLI = true; | ||
serverRoutes(app, config); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.