Apply for Zend Framework Certification Training

NodeJs





step - 1 (Setup main server)

 

npm init

npm install --save redis express

const express = require('express');
const app = express();
const countryService = require('./country-service');

app.get('/', function(req, res) {
    const {name} = req.query
    countryService(name, country => {
      res.end(country)
    })
});

app.listen(3000, function() {
  console.log('App listening on port 5000');
});

step - 2 (Create an cache.js file )

 

const redis = require('redis')
const client = redis.createClient()
client.on("error", function(err) {
  console.log("Error " + err);
})

module.exports = client

< Associations in sequelize How To Install Redis on Windows >



Ask a question



  • Question:
    {{questionlistdata.blog_question_description}}
    • Answer:
      {{answer.blog_answer_description  }}
    Replay to Question


Back to Top