Skip to content

Commit d447b44

Browse files
authored
Merge pull request #9 from neonexus/master
Removed need for use of EJS when serving React apps.
2 parents c2ef254 + aa8a9e4 commit d447b44

File tree

9 files changed

+36
-6
lines changed

9 files changed

+36
-6
lines changed

.idea/runConfigurations/Build.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations/Build_DEV.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/entry_template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<body>
1212
<div id="root">
1313
<div style="text-align: center; margin-top: 100px;">
14-
Please wait...
14+
LOADING...
1515
</div>
1616
</div>
1717
</body>

assets/src/Main/Main.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import React from 'react';
22
import {Button, Container} from 'react-bootstrap';
3+
import img from '../../images/sails-logo.png';
34

45
function Main() {
56
return (
67
<Container id="main-wrapper" style={{paddingTop: '50px'}}>
8+
<div className="text-center">
9+
<img src={img} alt="Sails Logo" />
10+
</div>
711
<h1>Main "application"</h1>
812
<div>The marketing site, if you will.</div>
913
<br />

assets/webapp_entry_template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<body>
1212
<div id="root">
1313
<div style="text-align: center; margin-top: 100px;">
14-
Please wait...
14+
LOADING...
1515
</div>
1616
</div>
1717
</body>

config/routes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports.routes = {
3838
if (fs.existsSync(pathToCheck)) {
3939
await sails.helpers.finalizeRequestLog(req, res, {body: 'view'});
4040

41-
return res.view('pages/homepage', {appToLoad: parts[1]});
41+
return res.type('html').send(fs.readFileSync(pathToCheck));
4242
}
4343

4444
res.status(404);

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sails-react-bootstrap-webpack",
3-
"version": "1.7.0",
3+
"version": "1.8.0",
44
"description": "An opinionated base configuration of Sails, with Webpack for React support, and Bootstrap for styling.",
55
"keywords": [
66
"sails",

views/pages/homepage.ejs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
<%- partial('../../.tmp/public/' + appToLoad + '/index.html') %>
1+
This is not being used. It is kept here as a placeholder, and to preserve folder structure.
2+
3+
EJS is still being used by Sails, and can be used to build things like emails.

0 commit comments

Comments
 (0)