A simple CRUD Node.js application using the DataStax Cassandra Driver and Express 4.
- Install DSE Cassandra
- Install Node.js
- Install Nodemon (Watches for changes and automatically restarts the server)
Install the dependencies and devDependencies and start the server.
$ cd mynewsletter
$ npm install
$ npm start
You'll then see the following in your terminal:
[nodemon] 1.18.9
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node server.js`
Express server listening on port 8080 in development mode
index: cassandra connected to index
subscribers: cassandra connected to subscribers
subscriber: cassandra connected to subscriber
addSubscriber: cassandra connected to add subscriber
editSubscriber: cassandra connected to editSubscriber
Navigate to: http://localhost:8080/
In another terminal, run cqlsh
and run the following:
-f schema.cql -k people