Okay so I'm having the worst luck in trying to figure out how to add Socket.io into an angular 2 app.
I'm using this angular 2 expresss starter. From the way I see it I'm suppose to add this socket.io dependencies inside typings.json
{
"globalDependencies": {
"body-parser": "registry:dt/body-parser#0.0.0+20160619023215",
"core-js": "registry:dt/core-js#0.0.0+20160602141332",
"express": "registry:dt/express#4.0.0+20160708185218",
"express-serve-static-core": "registry:dt/express-serve-static-core#4.0.0+20160715232503",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
"mime": "registry:dt/mime#0.0.0+20160316155526",
"node": "registry:dt/node#6.0.0+20160720070758",
"serve-favicon": "registry:dt/serve-favicon#0.0.0+20160316155526",
"serve-static": "registry:dt/serve-static#0.0.0+20160606155157"
},
"dependencies": {
"jsonwebtoken": "registry:npm/jsonwebtoken#5.5.4+20160208220328"
}
}
Where are they getting those values from?? Example : "registry:dt/express#4.0.0+20160708185218"
Another thing is the importing part.
import * as express from "express";
import { join } from "path";
import * as favicon from "serve-favicon";
import { json, urlencoded } from "body-parser";
I'm use to seeing
var express = require('express');
var socket_io = require('socket.io');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
So would this be correct?
import * as socket_io from "socket.io";