lundi 10 octobre 2016

unexpected end of input in app.js while running gulp command

In this i 'got so many error like port not identified somehow it got resolved but i don't know how...Also i got an unexpected error like unexpected end of input. And this is my coding.

app.js

var express = require('express');

var app = express();

var port = process.env.PORT || 3000;

var tutorRouter = express.Router();

tutorRouter.route('/Tutor')
   .get(function(req,res){
    var responseJson = {hello:"This is my api"};

res.json(responseJson);
});

//app.use('/api',tutorRouter);

var api = require('api'); 
var tutorRouter = api({tutorRouter});

app.get('/',function(req,res){
  res.send('welcome to my API') 
});


app.listen(port,function(){
       console.log('Running on port: '+port);'

gulpfile.js

var gulp = require('gulp'),
nodemon = require('gulp-nodemon');

gulp.task('default',function(){
   nodemon({
     script: 'app.js',
     ext: 'js',
     env:{
        PORT:8000
     },
     ignore: ['./node_modules/**']

   })

   .on('restart',function(){
   console.log('Restarting port:' +port);
    }); 
    });`

package.json

{
  "name": "tutor",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
   "test": "echo \"Error: no test specified\" && exit 1"
  },
     "author": "",
    "license": "ISC",
      "dependencies": {
     "express": "^4.14.0",
   "gulp": "^3.9.1",
   "gulp-nodemon": "^2.2.1"
    }
     }




Aucun commentaire:

Enregistrer un commentaire