Skip to content

Commit

Permalink
Merge pull request #4 from hoangsonww/feature/add-apis
Browse files Browse the repository at this point in the history
Add Backend APIs & Swagger Documentation
  • Loading branch information
hoangsonww authored Sep 5, 2024
2 parents 7512c1a + f026b31 commit 3f1dc0b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions backend/config/db.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const mongoose = require('mongoose');
require('dotenv').config();

// Connect to MongoDB
const connectDB = async () => {
try {
await mongoose.connect(process.env.MONGO_URI, {
Expand Down
2 changes: 1 addition & 1 deletion backend/seed/productSeeds.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ const seedDB = async () => {
console.log('Products data seeded successfully!');
};

//only run when the "node productSeeds.js dev" command is executed manually
// Only runs when the "node productSeeds.js dev" command is executed manually
if (process.argv[2] == 'dev') {
dotenv.config({ path: path.resolve(__dirname, '../.env') });
mongoose.connect(process.env.MONGO_URI, {}).then(async () => {
Expand Down
Binary file modified docs/swagger-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3f1dc0b

Please sign in to comment.