Skip to content

Commit

Permalink
replace herokuapp.com to fly.io
Browse files Browse the repository at this point in the history
  • Loading branch information
madhums committed Oct 11, 2023
1 parent b5b786e commit d08cc5a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/views/includes/head.pug
Expand Up @@ -10,7 +10,7 @@ head(prefix="og: http://ogp.me/ns# nodejsexpressdemo: http://ogp.me/ns/apps/node
meta(property="fb:app_id", content="293989217296609")
meta(property="og:title", content=pkg.name + ' - ' + title)
meta(property="og:description", content=pkg.description)
meta(property="og:url", content="http://nodejs-express-demo.herokuapp.com")
meta(property="og:url", content="http://nodejs-express-demo.fly.dev")
meta(property="og:site_name", content="Node.js Express Mongoose Demo")
meta(property="fb:admins", content="1037213945")

Expand Down
28 changes: 14 additions & 14 deletions config/express.js
Expand Up @@ -31,7 +31,7 @@ const env = process.env.NODE_ENV || 'development';
* Expose
*/

module.exports = function(app, passport) {
module.exports = function (app, passport) {
app.use(
helmet({
contentSecurityPolicy: {
Expand All @@ -40,25 +40,25 @@ module.exports = function(app, passport) {
'script-src': ["'self'", 'code.jquery.com'],
'style-src': ["'self'", "'unsafe-inline'", 'netdna.bootstrapcdn.com'],
'img-src': ["'self'", 'data:', 'github.com'],
'frame-src': ["'self'", 'ghbtns.com']
}
}
'frame-src': ["'self'", 'ghbtns.com'],
},
},
})
);
app.use(requireHttps);

// Compression middleware (should be placed before express.static)
app.use(
compression({
threshold: 512
threshold: 512,
})
);

app.use(
cors({
origin: ['http://localhost:3000', 'https://reboil-demo.herokuapp.com'],
origin: ['http://localhost:3000', 'https://reboil-demo.fly.dev'],
optionsSuccessStatus: 200, // some legacy browsers (IE11, various SmartTVs) choke on 204
credentials: true
credentials: true,
})
);

Expand All @@ -70,8 +70,8 @@ module.exports = function(app, passport) {
if (env !== 'development') {
log = {
stream: {
write: message => winston.info(message)
}
write: (message) => winston.info(message),
},
};
}

Expand All @@ -84,7 +84,7 @@ module.exports = function(app, passport) {
app.set('view engine', 'pug');

// expose package.json to views
app.use(function(req, res, next) {
app.use(function (req, res, next) {
res.locals.pkg = pkg;
res.locals.env = env;
next();
Expand All @@ -95,7 +95,7 @@ module.exports = function(app, passport) {
app.use(bodyParser.urlencoded({ extended: true }));
app.use(upload.single('image'));
app.use(
methodOverride(function(req) {
methodOverride(function (req) {
if (req.body && typeof req.body === 'object' && '_method' in req.body) {
// look in urlencoded POST bodies and delete it
var method = req.body._method;
Expand All @@ -114,8 +114,8 @@ module.exports = function(app, passport) {
secret: pkg.name,
store: MongoStore.create({
mongoUrl: config.db,
collection: 'sessions'
})
collection: 'sessions',
}),
})
);

Expand All @@ -133,7 +133,7 @@ module.exports = function(app, passport) {
app.use(csrf());

// This could be moved to view-helpers :-)
app.use(function(req, res, next) {
app.use(function (req, res, next) {
res.locals.csrf_token = req.csrfToken();
res.locals.paginate = ultimatePagination.getPaginationModel;
next();
Expand Down

0 comments on commit d08cc5a

Please sign in to comment.