Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gustavohenrique/nodejs-redis-example
A scalable application with NodeJS and Redis
https://github.com/gustavohenrique/nodejs-redis-example
Last synced: about 1 month ago
JSON representation
A scalable application with NodeJS and Redis
- Host: GitHub
- URL: https://github.com/gustavohenrique/nodejs-redis-example
- Owner: gustavohenrique
- Created: 2014-08-16T21:31:11.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-08-19T20:30:23.000Z (over 10 years ago)
- Last Synced: 2024-04-16T03:18:24.506Z (9 months ago)
- Language: JavaScript
- Size: 629 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
nodejs-redis-example
====================## About
This is a simple scalable application using NodeJS and Redis.
The application is divided in 2 parts: *client* (static HTML + Javascript) and *server* (NodeJS + Redis).## Client
The client module is a HTML + JQuery for consumes the server's API. Easy to cache using a HTTP Servers like Nginx/Apache.
## Server
The server module is a javascript application using NodeJS and Redis for persistence.
## How to run?
### Using Vragrant
Just clone the repository and run *vagrant up*.
After Vagrant download and configure the virtual machine, you'll can access on *http://localhost:8001*. The API is running on *http://localhost:3000*### Using Docker
Install *boot2docker* if you are using OS X or Windows:
boot2docker --memory=1024 --vm=node-redis-example --hostip=172.16.123.123 init
boot2docker --vm=node-redis-example up
boot2docker --vm=node-redis-example ssh
git cloneRun the Docker inside the Linux vm:
docker build -t=node-redis-example .
docker run -d -p 3000:3000 -p 8001:80 node-redis-exampleNow you can open the index.html in your browser on http://172.16.123.123:8001
### Without Vagrant or Docker
If you don't run by Vagrant or Docker you can see the Vagrantfile that contains a shell script for automate the configuration.
Basically you just have to install NodeJS and the project dependencies and run node server.js.
Open the client/dist/index.html in your browser and enjoy it.### API Usage
# Get scores
curl -X GET http://localhost:3000/poll/scores# Vote to incremment the score
curl -X POST http://localhost:3000/poll/vote/## Technologies
* GulpJS
* Bower
* SemanticUI
* JQuery
* NodeJS
* Mocha and Chai
* Redis## License
MIT