Skip to content

Commit

Permalink
fixes server type mismatch angular-university#2;
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlistopadov committed Aug 20, 2019
1 parent d3f62bd commit 3a0c0f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Application } from 'express';
import { getAllCourses, getCourseById } from './get-courses.route';
import { searchLessons } from './search-lessons.route';
import { saveCourse } from './save-course.route';
import { AddressInfo } from 'net';

const bodyParser = require('body-parser');

Expand All @@ -19,7 +20,6 @@ app.route('/api/lessons').get(searchLessons);
app.route('/api/courses/:id').put(saveCourse);

const httpServer = app.listen(9000, () => {
const addr = httpServer.address();
const bind = typeof addr === 'string' ? `pipe ${addr}` : `port ${addr.port}`;
console.log(`HTTP REST API Server running at http://localhost: ${bind}`);
const { port } = httpServer.address() as AddressInfo;
console.log(`HTTP REST API Server running at http://localhost: ${port}`);
});

0 comments on commit 3a0c0f2

Please sign in to comment.