Skip to content

Commit

Permalink
chore: update project dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
thrsouza committed Dec 12, 2024
1 parent efede15 commit f0c81d2
Show file tree
Hide file tree
Showing 11 changed files with 1,186 additions and 2,955 deletions.
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules/
.vscode/

.editorconfig
.eslintrc.json
.env
16 changes: 0 additions & 16 deletions .eslintrc.json

This file was deleted.

130 changes: 129 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,130 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
.vscode/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ This project was created as an example of "How to Create a Nodejs API" for educa
### Requirements

- [Nodejs](https://nodejs.org/)
- [Yarn](https://yarnpkg.com/)
- [VS Code](https://code.visualstudio.com/)
- [Docker](https://www.docker.com/products/docker-engine)

Expand Down Expand Up @@ -190,10 +189,3 @@ $ docker run --name node-books-api -p 3000:3000 -d somadevs/node-books-api
// DELETE http://localhost:3000/api/books/:id
// RESPONSE (STATUS: 204)
```

<hr />

<small>
MEDIUM: https://medium.com/@thiagodesouza.io<br>
E-MAIL: [email protected] <br>
</small>
18 changes: 18 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
services:
books_api:
container_name: books_api
build: .
ports:
- "3000:3000"
environment:
- PORT=3000
- MONGO_CONNECTION_STRING=mongodb://books_db:27017/node-books-api
depends_on:
- books_db


books_db:
image: mongo
container_name: books_db
ports:
- "27017:27017"
7 changes: 4 additions & 3 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ FROM node

WORKDIR /app
COPY package.json ./
COPY yarn.lock ./
COPY pnpm-lock.yaml ./
RUN corepack enable

RUN yarn --prod
RUN pnpm install

COPY . .

EXPOSE 3000

CMD ["yarn", "start:prod"]
CMD ["pnpm", "start"]
20 changes: 8 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@
"main": "src/server.js",
"license": "MIT",
"scripts": {
"start": "nodemon src/server.js",
"start:prod": "node src/server.js"
"dev": "nodemon src/server.js",
"start": "node src/server.js"
},
"dependencies": {
"express": "^4.16.4",
"mongoose": "^5.7.5"
"dotenv": "^16.4.7",
"express": "^4.21.2",
"mongoose": "^8.8.4"
},
"devDependencies": {
"eslint": "^5.14.1",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"nodemon": "^1.18.10"
}
"nodemon": "^3.1.7"
},
"packageManager": "[email protected]+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c"
}
Loading

0 comments on commit f0c81d2

Please sign in to comment.