npm install smart-house-backend




Install dependencies:
``sh`
npm install
sh
set DEBUG env variable to get debug logs
DEBUG=express-mongoose-es6-rest-api:* npm startor without debug
npm start
`$3
`sh
will run api backend
npm run api
`$3
`sh
run unit and integration tests
npm test
``sh
run all tests with coverage
npm run test-coverage
``sh
run only unit tests
npm run test:unit
watch mode
npm run test-watch:unit
``sh
run only integration tests
npm run test:integration
watch mode
npm run test-watch:integration
`
$3
`sh
Lint code with ESLint
npm run lint
`Logging
Universal logging library winston is used for logging. It has support for multiple transports. A transport is essentially a storage device for your logs. Each instance of a winston logger can have multiple transports configured at different levels. For example, one may want error logs to be stored in a persistent remote location (like a database), but all logs output to the console or a local file. We just log to the console for simplicity, you can configure more transports as per your requirement.
#### API logging
Logs detailed info about each api request to console during development.
!Detailed API logging
#### Error logging
Logs stacktrace of error to console along with other details. You should ideally store all error messages persistently.
!Error logging
Code Coverage
Get code coverage summary on executing npm test
!Code Coverage Text Summarynpm test also generates HTML code coverage report in coverage/ directory. Open lcov-report/index.html` to view it.