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