README.md

June 26, 2019 ยท View on GitHub

#Angular Podcast App - Server

A Nodejs Rest API to serve the Angular Podcast App.

Build the app

  • execute npm run build from a terminal window

Getting TypeScript

TypeScript itself is simple to add to any project with npm.

npm install -D typescript

Running the build

Npm ScriptDescription
startDoes the same as 'npm run serve'. Can be invoked with npm start
buildFull build. Runs ALL build tasks (build-sass, build-ts, tslint, copy-static-assets)
serveRuns node on dist/server.js which is the apps entry point
watch-nodeRuns node with nodemon so the process restarts if it crashes. Used in the main watch task
watchRuns all watch tasks (TypeScript, Sass, Node). Use this if you're not touching static assets.
testRuns tests using Mocha test runner
watch-testRuns tests in watch mode
build-tsCompiles all source .ts files to .js files in the dist folder
watch-tsSame as build-ts but continuously watches .ts files and re-compiles when needed
tslintRuns TSLint on project files
debugPerforms a full build and then serves the app in watch mode
serve-debugRuns the app with the --inspect flag
watch-debugThe same as watch but includes the --inspect flag so you can attach a debugger

Running tests

Simply run npm run test. Note this will also generate a coverage report.

Running TSLint

Like the rest of our build steps, we use npm scripts to invoke TSLint. To run TSLint you can call the main build script or just the TSLint task.

npm run build   // runs full build including TSLint
npm run tslint  // runs only TSLint