Good morning, I wonder if you have a repository for this project.
Giovanni Fersan

Unfortunately, I don’t have a sample project created for this. I was doing this for a proprietary project when I wrote this article. I have trimmed out anything private though and here are snippets of the files you mentioned.

You may have to make some minor adjustments to these files to get them up to date. The version of the project I am referencing here was written over a year ago. Since then, TypeScript has reached version 2, Node has reached version 8, and Angular has reached version 4.

tsconfig.json (Server):

"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "./app",
"sourceMap": true,
"emitDecoratorMetadata": false,
"removeComments": false,
"noImplicitAny": false
"exclude": [

Note that many of the settings here are just how you want them, such as noImplicitAny. The things that are specific to this project here are outDir and the exclude section.

From what I remember, the outDir didn’t actually end up being necessary because it is set with gulp.dest in the build process, so maybe try omitting that and see if it still works.

tsconfig.json (Client):

The client config file is basically the same, with the following exceptions:

  • Set emitDecoratorMetadata to true and add experimentalDecorators: true for Angular
  • Change the "../client" to "../server" under the "exclude" section


I don’t put much in my root file, just imports of configurations:

process.env.NODE_ENV = process.env.NODE_ENV || 'development';
import mongoose from './config/mongoose';
const db = mongoose();
import express from './config/express';
const app = express();
app.listen(app.get('port'), function(err) {
if (!err) {
console.log('Server running at http://localhost:' + app.get('port') + '/');
} else {
export default app;


The ./config/express file is what contains the only code that needs to be included exclusively for this project structure:

import * as express from 'express';
import * as bodyParser from 'body-parser';
import * as morgan from 'morgan';
import config from './config';
// route name removed for confidentiality reasons
import xxxRoute from '../routes/xxx.route';
const BASE_API_URL = '/api';
export default function(): express.Application {
const app = express();
  if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test') {
  app.use(bodyParser.urlencoded({ extended: true });
  app.use(BASE_API_URL + '/xxx', xxxRoute);
  // include the static content for the Angular app
app.use('/node-modules', express.static('./node_modules'));
  app.set('port', config.port);
  return app;
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.