TypeScript-Node-Starter
TypeScript-Node-Starter copied to clipboard
feat(Root): Development mode using nodemon with custom type loading
Implementation to run in development mode using nodemon loading custom types in order to prevent errors when running the server in development mode.
The error that is being prevented by loading the express-session-types type is the following:
Property 'returnTo' does not exist on type 'Session & Partial<SessionData>'.
req.session.returnTo = req.path;
Which is avoided by importing the following line into the app.ts file:
import * as sessionTypes from "./types/express-session-types";
With this we achieve the execution in development mode with the command npm run dev.
Hey,
thanks for pr, but it won't work as part of the example, as the direct TS workflow does not work in current setup for non-TS (non-javasript) assets, like images and styles. So the page starts, allow development, but there is no support for other assets. This is why existing nodemon usage support is based on serving content from dist directory