sample: https://nestjs-react-htm-sample.herokuapp.com/
Non-build React uses data from server-side AppService
.
-
Use
Handlebars
template engine. (follow this doc)src/main.ts
views/index.hbs
-
Non-build React with htm.
/public/js/index.js
views/index.hbs
(script withtype="module"
)
-
SSR with embeded JSON data.
src/app.controller.ts
views/index.hbs
$ yarn install
# development
$ yarn start
# watch mode
$ yarn start:dev
# production mode
$ yarn start:prod
# unit tests
$ yarn test
# e2e tests
$ yarn test:e2e
# test coverage
$ yarn test:cov