Home Fat arrow function throwing error "expression expected"
Reply: 0

Fat arrow function throwing error "expression expected"

user866 Published in July 20, 2018, 4:48 am

I am setting up my server.js file in angular following a tutorial. In the tutorial he has no errors while my fat arrow funtion is saying "expression expected". I am new to javascript and mainly know Java.


var express = require('express');
var bodyParser = require('body-parser');
var path = require('path');
var http = require(http);
var app = express();

var api = require('./server'/api);

app.use(bodyParser.urlencoded({extended: false}));

app.use(express.static(path.join(__dirname, 'dist')));

app.use('/', api);

app.get('*'), (req, res) => {
  res.sendFile(path.join(__dirname, "dist/index.html"));

var port = precess.env.PORT || '3000';
app.set('port', port);

var server = http.createServer(app);
server.listen(port, () => console.log("Server is running"));
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.372516 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO