A basic example to try the CEAN stack and explore the new N1QL syntax
It implements some CRUD operations on users via REST calls from AngularJS, which are redirected by Node.js to the appropriate data layer methods (see recordmodel.js)
Before using this app, the following need to be installed:
After everything is installed there is a setup phase for the app to work, which consists on the following steps:
- Install dependencies:
npm install
- Prepare Couchbase
-
Create a new bucket called restful-sample using the Admin UI
-
Create an index from the command line using CBQ: Launch CBQ
./Applications/Couchbase Server.app/Contents/Resources/couchbase-core/bin/cbq
CREATE PRIMARY INDEX ON `restful-sample` USING GSI;
-
You are now ready to use the app.
node app.js
You can customize the bucket name in config.json It is assumed you are using localhost and the following ports as default:
- 8091: default Couchbase port
- 5000: Node.js is bound to this port. You can change it in config.json