An open API service indexing awesome lists of open source software.

https://github.com/juan-medina/openshift

openshift examples
https://github.com/juan-medina/openshift

Last synced: 3 months ago
JSON representation

openshift examples

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 PaaS

Everything is prepare in a docker style app, when you build will install node modules and bower libraries

#PREREQUISITES
Setup you Open Shift client tools

https://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_PORT

OPENSHIFT_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