Himmators Himmators - 1 year ago 71
Node.js Question

sqlite or Sequlize seems to have broken my app

I have a node js app that doesn't work since I installed packages sqlight or sequlize.

This is my index.js file:

var express = require('express'),
app = express();

app.get('/', (req, res) =>{
res.send('hello world');

I put
runjs index.js
in my terminal, response: Starting: index.js, theese are my dependencies:

"dependencies": {
"express": "^4.13.4",
"passport": "^0.3.2",
"passport-facebook-token": "^3.2.0",
"passport-local": "^1.0.0",
"sequelize": "^3.23.3",
"sqlite3": "^3.1.4"

Visiting localhost:3000 renders the response

This site can’t be reached – ERR_CONNECTION_REFUSED

What might cause this?

Answer Source

Make sure you have a listener method as well.

This should work:

var express = require('express');
var app = express();

app.get('/', function(req, res){
  res.send('hello world');

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download