-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first version of the template completed
- Loading branch information
0 parents
commit 0cbdffe
Showing
12 changed files
with
793 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
node_modules/ | ||
.jshintrc | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
|
||
# Folders | ||
dist/ | ||
node_modules/ | ||
|
||
# OTHERS | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"esversion": 6 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM node:alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json . | ||
|
||
RUN npm install | ||
|
||
COPY dist . | ||
|
||
ENV PORT 8080 | ||
|
||
EXPOSE 8080/tcp | ||
|
||
CMD ["node", "index"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Template microservices (node + express) # | ||
|
||
## Release notes ## | ||
| Modules | Version | | ||
|:-----------: |:-------: | | ||
| body-parser | ^1.19.0 | | ||
| cors | ^2.8.5 | | ||
| express | ^4.16.4 | | ||
|
||
### tree files ### | ||
``` | ||
/template | ||
| node_modules/ | ||
| dist/ | ||
| src/ | ||
|____ class/ | ||
|____ global/ | ||
|____ routes/ | ||
|____ global/ | ||
|____ middleware/ | ||
|____ index.ts | ||
| .dockerignore | ||
| .jshintrc | ||
| Dockerfile | ||
| package.lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
``` | ||
|
||
|
||
### Typescript compilation ### | ||
``` | ||
tsc -w | ||
``` | ||
|
||
### How to execute local? ### | ||
node command | ||
``` | ||
$ node dist/index.js | ||
``` | ||
|
||
nodemon command | ||
``` | ||
$ nodemon dist/index.js | ||
``` | ||
|
||
### How to execute in Docker? ### | ||
| Docker attribute | Attribute | | ||
|:---------------: |:----------: | | ||
| IMAGE | node:alpine | | ||
| PORT EXPOSE | 8080 | | ||
|
||
build Dockerfile | ||
``` | ||
$ docker build -t micro/<name>:<tag> . | ||
``` | ||
|
||
run container | ||
``` | ||
$ docker run -d --name <name> -p 8080:8080 micro/<name>:<tag> | ||
``` |
Oops, something went wrong.