Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Changed to use hospitalrun-server-routes
Browse files Browse the repository at this point in the history
  • Loading branch information
jkleinsc committed Feb 23, 2016
1 parent d9a795e commit a90d132
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 187 deletions.
18 changes: 13 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "hospitalrun",
"version": "0.9.0",
"description": "Small description for hospitalrun goes here",
"private": true,
"description": "Ember front end for HospitalRun",
"homepage": "http://hospitalrun.io",
"directories": {
"doc": "doc",
"test": "tests"
Expand All @@ -12,12 +12,19 @@
"start": "./script/server",
"test": "./script/test"
},
"repository": "",
"repository": {
"type": "git",
"url": "git@github.com:HospitalRun/hospitalrun-frontend"
},
"engines": {
"node": ">= 0.10.0"
},
"author": "",
"license": "MIT",
"author": "John Kleinschmidt",
"contributors": [
"Joel Worrall",
"Joel Glovier"
],
"license": "GPL-3.0",
"devDependencies": {
"body-parser": "^1.14.2",
"broccoli-asset-rev": "^2.4.1",
Expand Down Expand Up @@ -58,6 +65,7 @@
"ember-validations": "2.0.0-alpha.4",
"express": "^4.8.5",
"glob": "^7.0.0",
"hospitalrun-server-routes": "0.9.0",
"nano": "6.2.0",
"request": "2.69.0"
},
Expand Down
42 changes: 21 additions & 21 deletions server/config-example.js
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;
17 changes: 0 additions & 17 deletions server/forward.js

This file was deleted.

19 changes: 4 additions & 15 deletions server/index.js
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);
};
7 changes: 0 additions & 7 deletions server/routes/couchproxy.js

This file was deleted.

50 changes: 0 additions & 50 deletions server/routes/couchuser.js

This file was deleted.

64 changes: 0 additions & 64 deletions server/routes/searchproxy.js

This file was deleted.

8 changes: 0 additions & 8 deletions server/routes/server.js

This file was deleted.

0 comments on commit a90d132

Please sign in to comment.