Skip to content

Commit

Permalink
Add absent MIME Content type for PEG.js grammar files
Browse files Browse the repository at this point in the history
* This allows the browser to view these instead of downloading
* May also prevent some warnings from security sites
* Using generic JavaScript MIME type as that is what my editor is saying it is on auto-detect... PEG.js is very closely related to JavaScript so should be okay.

Applies to OpenUserJS#285
  • Loading branch information
Martii committed Jul 18, 2015
1 parent 58c3c15 commit d1c4c12
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ app.use(bodyParser.json({
app.use(compression());
app.use(methodOverride('X-HTTP-Method-Override'));

// Add absent from server MIME Content Type for PEG Grammar files
express.static.mime.define({
'text/javascript': ['pegjs']
});

// Order is very important here (i.e mess with at your own risk)
app.use(passport.initialize());
app.use(session({
Expand Down

0 comments on commit d1c4c12

Please sign in to comment.