Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesGarth committed Jun 29, 2023
0 parents commit 6fb9ec3
Show file tree
Hide file tree
Showing 7 changed files with 1,447 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_modules
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.3.1
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:20
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD [ "npm", "start" ]
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.1'
services:
api:
build: ./
command: npm start
volumes:
- ./node-vite-ts-express:/node-vite-ts-express
expose:
- "3000"
ports:
- "3000:3000"
environment:
- PORT=3000
15 changes: 15 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import express, { Express, Request, Response } from 'express';
import dotenv from 'dotenv';

dotenv.config();

const app: Express = express();
const port = process.env.PORT || 3000;

app.get('/', (req: Request, res: Response) => {
res.send('Hello World!');
});

app.listen(port, () => {
console.log(`Example app listening on port ${port}`);
});
Loading

0 comments on commit 6fb9ec3

Please sign in to comment.