Skip to content

drstm/ts-express-starter-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Starter kit for express and typescript

To be very clear, this is an opinionated idea of how to integrate the express framework with typescript (and connect to mysql). This is not necessarily the best way to do it, instead it is what works best for me and a layout whose organization makes sense to me.

Dependencies

A lot of it is standard express dependencies with additional packages for type support.

  • The first departure from a standard express pattern is in routes handled by express-enrouten
  • I have added in lodash because I felt it helped me not reinvent the wheel despite some of the features being added into newer versions of javascript.
  • Moment is super useful for any datetime needs and I eventually find myself installing this sooner or later
  • Sequelize and sequelize-cli are used to create the structure inside the db folder. The connection.ts file provides an object connected to the db as specified in the root config folder.

Run

For local testing I prefer to use nodemon as: nodemon --watch 'src/**/*.ts' --ignore 'src/**/*.spec.ts' --exec 'ts-node' src/index.ts

Other than that npm run start is enough. It builds the project using tsc into a dist folder serves it.

Contributing

I would love to know if I can make this setup any easier, feel free to make a PR to improve it!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors