This repository is based on BeerLocker V.4 found here: https://github.com/scottksmith95/beerlocker/tree/master/beerlocker-4 I've made a couple of change in order to use it on iPhone application as API Service.
What Beer Server Use:
- MongoDB as Database
- NodeJS as Application Server
- NodeJS: you can find your version here: https://nodejs.org/en/
- MongoDB: you can find installation instruction on MongoDB Website
To install MongoDB on OSX follow this steps
- Install Brew (very simple, just follow the single line instruction at: http://brew.sh/)
- Run
brew install mongodb
on OSX Platform - Create data directory:
sudo mkdir -p /data/db
- Change directory permission: `sudo chown -R $USER /data/db``
- Test MongoDB installation running the command
mongod
Go into the directory where you have clone this repository and hit this commands
- `openssl genrsa -des3 -out server.enc.key 1024``
- `openssl req -new -key server.enc.key -out server.csr``
- `openssl rsa -in server.enc.key -out server.key``
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
When the server start, will find server.key
and server.crt
, so is very important that the certificates are in the server directory.
When the previous steps are done, you can just type node server.js
and if all was gone right you should see the message Server started at port 5001