diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..aa534df --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node + +COPY . /app + +WORKDIR /app + +RUN npm install + +ENV PORT=80 + +EXPOSE 80 + +CMD ["npm", "start"] \ No newline at end of file diff --git a/src/api/app.js b/src/api/app.js index d7e7a62..954e197 100644 --- a/src/api/app.js +++ b/src/api/app.js @@ -5,8 +5,12 @@ const errorMiddleware = require('../middlewares/error'); const app = express(); -app.get('/users', rescue(UserController)); +app.use((req, res, next) => { + res.setHeader('Access-Control-Allow-Origin', '*'); + next(); +}) +app.get('/users', rescue(UserController)); app.use(errorMiddleware); module.exports = app;