Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jeancarlos-cpu committed Dec 10, 2019
1 parent 7552ea9 commit aa9090e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
3 changes: 2 additions & 1 deletion config/dev.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
PRISMA_ENDPOINT=http://192.168.99.100:4466
PRISMA_SECRET=f3fasa9b7fda7f7d8s9af7sa6fds9a6fsda0f6dsa6vg
JWT_SECRET=fdsa7f96oli6sdiFUD29df5dsa950mblyde
JWT_SECRET=fdsa7f96oli6sdiFUD29df5dsa950mblyde
WHITE_LIST=http://localhost:3000
3 changes: 2 additions & 1 deletion config/prod.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
NODE_ENV=production
PRISMA_ENDPOINT=https://blogging-app-9d8770a311.herokuapp.com/blogging-app/prod
PRISMA_SECRET=HhFHHfdhuswU43ehhw324fHWh432fsfGWFW74327W8GFFHfdsfhfhds
JWT_SECRET=freqfreq31h1478jhgnwe21hy652hew264nhx
JWT_SECRET=freqfreq31h1478jhgnwe21hy652hew264nhx
WHITE_LIST=https://jeancarlos-cpu.github.io
20 changes: 10 additions & 10 deletions src/apollo-sever.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ const limiter = rateLimit({
max: 100 // limit each IP to 100 requests per windowMs
});

// const csp = helmet.contentSecurityPolicy({
// directives: {
// defaultSrc: ["'self'"],
// styleSrc: ["'self'", "192.168.99.100:4466/"]
// }
// });
const csp = helmet.contentSecurityPolicy({
directives: {
defaultSrc: ["'self'"],
styleSrc: ["'self'"]
}
});

const whitelist = ["https://jeancarlos-cpu.github.io/"];
const whitelist = [process.env.WHITE_LIST];

const corsOptions = {
origin: (origin, callback) =>
Expand All @@ -30,8 +30,8 @@ const corsOptions = {
};

const app = express();
// app.use(helmet());
// app.use(csp);
app.use(helmet());
app.use(csp);
app.use(cors(corsOptions));
app.use(limiter);
app.use(compression());
Expand All @@ -46,7 +46,7 @@ const server = new ApolloServer({
});

server.applyMiddleware({ app });
app.listen({ port: process.env.PORT || 4000 }, () => console.log("server up."));
app.listen({ port: process.env.PORT || 4000 }, () => console.log(whitelist));

// server
// .listen({ port: process.env.PORT || 4000 })
Expand Down

0 comments on commit aa9090e

Please sign in to comment.