https://github.com/juan-medina/openshift
openshift examples
https://github.com/juan-medina/openshift
Last synced: 3 months ago
JSON representation
openshift examples
- Host: GitHub
- URL: https://github.com/juan-medina/openshift
- Owner: juan-medina
- Created: 2015-10-17T10:24:43.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-18T08:31:36.000Z (over 9 years ago)
- Last Synced: 2025-01-12T23:12:18.359Z (5 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.77 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
#MEAN examples on OpenShift
Work in progress examples for creating a NodeJS / Express / MongoDB RESTFull API with a AngularJS/Boostrap client under OpenShift PaaSEverything is prepare in a docker style app, when you build will install node modules and bower libraries
#PREREQUISITES
Setup you Open Shift client toolshttps://developers.openshift.com/en/getting-started-overview.html
$ rhc setup
#SETUP ON OpenShift
$ rhc app create nodejs-0.10 mongodb-2.4 -s --from-code=https://github.com/cecile/openshift.git
#BUILD IN OpenShift
$ rhc push origin master
#SETUP ON LOCAL
- Install NodeJS
http://nodejs.org/- Install MongoDB
http://www.mongodb.org/downloads- Launch MongoDB
$ mongod --dbpath- Add admin user to MongoDB
$ mongo
> use admin
> db.createUser(
{
user: "",
pwd: "",
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
}
)- Set Environment variables
OPENSHIFT_NODEJS_IP
OPENSHIFT_NODEJS_PORTOPENSHIFT_MONGODB_DB_HOST
OPENSHIFT_MONGODB_DB_PORT
OPENSHIFT_MONGODB_DB_USERNAME
OPENSHIFT_MONGODB_DB_PASSWORD#BUILD IN LOCAL
$ npm install
$ npm start#FILES
- Server Side
| ---------------------- | --------------------- |
| Node Server | ./server.js |
| ---------------------- | --------------------- |
| Express Application | ./app/routes.js |
| | ./app/api.js |
| ---------------------- | --------------------- |
| MongoDB JS models | ./app/models |
| ---------------------- | --------------------- |
| Node Modules | ./package.json |
| ---------------------- | --------------------- |- Client Side
| ---------------------- | ------------------------ |
| Bower | ./bower.json |
| | ./.bowerrc |
| | ./static/libs |
| ---------------------- | ------------------------ |
| Sinple Page HTML | ./static/index.html |
| ---------------------- | ------------------------ |
| AngularJS code | ./static/js/app.js |
| | ./static/js/appRoutes.js |
| ---------------------- | ------------------------ |
| AngularJS Services | ./static/js/services |
| ---------------------- | ------------------------ |
| AngularJS Controllers | ./static/js/controllers |
| ---------------------- | ------------------------ |
| AngularJS Views | ./static/views |
| ---------------------- | ------------------------ |#REFERENCES
Based on
https://github.com/cecile/meanexample