mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-25 22:37:18 +10:00
Format code with Prettier
This commit is contained in:
parent
ac40c080c4
commit
f6ca7da23c
4 changed files with 4 additions and 16 deletions
|
|
@ -5,7 +5,6 @@ const auth = require('basic-auth');
|
|||
* against the given credentials.
|
||||
*/
|
||||
exports.basicAuth = (username, password) => {
|
||||
|
||||
if (!username || !password) {
|
||||
throw new Error('Missing required username and password for basic authentication.');
|
||||
}
|
||||
|
|
@ -17,9 +16,7 @@ exports.basicAuth = (username, password) => {
|
|||
next();
|
||||
} else {
|
||||
res
|
||||
.set({
|
||||
'WWW-Authenticate': 'Basic realm="Authentication required"',
|
||||
})
|
||||
.set({ 'WWW-Authenticate': 'Basic realm="Authentication required"' })
|
||||
.status(401)
|
||||
.end("I'm afraid I cannot let you do that.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ const indexHtml = fs.readFileSync(path.join(buildPath, 'index.html'), 'utf-8');
|
|||
|
||||
const reNoMatch = /($^)/;
|
||||
const template = _.template(indexHtml, {
|
||||
|
||||
// Interpolate variables in the HTML template with the following
|
||||
// syntax: <!--!variableName-->
|
||||
//
|
||||
|
|
@ -61,7 +60,6 @@ const template = _.template(indexHtml, {
|
|||
// - https://github.com/kangax/html-minifier
|
||||
// - Plugin options in the production Webpack configuration file
|
||||
interpolate: /<!--!([\s\S]+?)-->/g,
|
||||
|
||||
// Disable evaluated and escaped variables in the template
|
||||
evaluate: reNoMatch,
|
||||
escape: reNoMatch,
|
||||
|
|
@ -69,10 +67,7 @@ const template = _.template(indexHtml, {
|
|||
|
||||
function render(url, context) {
|
||||
const { head, body } = renderApp(url, context);
|
||||
return template({
|
||||
title: head.title.toString(),
|
||||
body
|
||||
});
|
||||
return template({ title: head.title.toString(), body });
|
||||
}
|
||||
|
||||
const env = process.env.NODE_ENV;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
import Page from './Page/Page';
|
||||
|
||||
export {
|
||||
Page
|
||||
};
|
||||
export { Page };
|
||||
|
|
|
|||
|
|
@ -32,6 +32,4 @@
|
|||
* Note that this file is required for the build process.
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
|
||||
};
|
||||
module.exports = {};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue