skip to Main Content

I'm trying to create a container from an image of a small project, but I get an error: docker: Error response from daemon

DockerFile FROM node:latest WORKDIR /app COPY . . RUN npm install EXPOSE 8080 ENTRYPOINT ["nodemon", "server.js"] Server.js const express = require('express'); const swaggerUi = require('swagger-ui-express'); const app = express(); const userRouter = require('./routes/userRoutes'); const productRouter = require('./routes/productsRoutes'); const swaggerFile =…

VIEW QUESTION

Mongodb returns an empty array while retrieving data through nodejs

let mongodb = require('mongodb').MongoClient; let express = require("express") let app = express() let connectionString = 'mongodb://ToDoAppUser:[email protected]:27017,ac-u9kgapm-shard-00-01.8rdkdoi.mongodb.net:27017,ac-u9kgapm-shard-00-02.8rdkdoi.mongodb.net:27017/?ssl=true&replicaSet=atlas-68qno6-shard-0&authSource=admin&retryWrites=true&w=majority' let db mongodb.connect(connectionString,function(err,client){ if (err) throw err db = client.db() app.listen(3000) console.log("Database connected."); }) app.use(express.urlencoded({extended : false})) Trying to retrieve data from MongodB As…

VIEW QUESTION
Back To Top
Search