express-ts-bp
v1.0.2
Published
A boilerplate for an Express app using TypeScript and EJS
Downloads
226
Maintainers
Readme
ts-app-bp
A boilerplate for an Express app using TypeScript and EJS.
Features
- Easy setup for an Express application with TypeScript.
- EJS templating for dynamic HTML rendering.
- Static file serving.
- Simple folder structure for organization.
Folder Structure
my-app/
│
├── src/
│ ├── public/
│ │ ├── styles.css
│ │ ├── images/
│ │ │ └── image.png
│ │ └── index.html
│ ├── views/
│ │ └── index.ejs
│ └── server.ts
├── dist/
│ └── (transpiled JavaScript files will be generated here by tsc)
├── package.json
└── tsconfig.json
Installation
Global Installation
To install the package globally, run:
npm install -g express-ts-bp
After installation, you can create a new Express TypeScript application by running:
create-express-ts-bp my-app
Using npx
If you prefer not to install globally, you can use npx
to create a new application directly:
npx express-ts-bp my-app
This will create a new folder named my-app
with the boilerplate structure.
Usage
After creating your app, navigate into your project directory:
cd my-app
To install dependencies, run:
npm install
Run the Server
To start our server we will need two terminals, one to run the typescript transpiler (which will generates the dist folder containing the compiled JavaScript files) and one to run our node server.
First Terminal:
tsc -w
Second Terminal:
nodemon dist/server.js