-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from andela-iamao/ft-configure-express-38
#38 Add Express Support
- Loading branch information
Showing
25 changed files
with
456 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* global expect:true */ | ||
/* global shallow:true */ | ||
|
||
import React from 'react';//eslint-disable-line | ||
|
||
import About from '../../src/components/static/About.component.jsx'; | ||
|
||
describe('<About />', () => { | ||
it('should have a heading text of h2', () => { | ||
const wrapper = shallow( | ||
<About /> | ||
); | ||
expect(wrapper.find('h2')).to.have.length(1); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* global expect:true */ | ||
/* global mount:true */ | ||
|
||
import React from 'react';//eslint-disable-line | ||
|
||
import Common from '../../src/components/common/Common.component.jsx'; | ||
|
||
describe('<Common />', () => { | ||
it('should render the child components', () => { | ||
const wrapper = mount(<Common ><h3>Common</h3></Common>); | ||
expect(wrapper.props().children.type).to.eql('h3'); | ||
expect(wrapper.props().children.props.children).to.eql('Common'); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
/* global expect:true */ | ||
/* global shallow:true */ | ||
/* global mount:true */ | ||
|
||
import React from 'react';//eslint-disable-line | ||
|
||
import Home from '../../src/components/Home.component'; | ||
import Home from '../../src/components/Home.component.jsx'; | ||
|
||
describe('<Home />', () => { | ||
it('should have a heading text', () => { | ||
const wrapper = shallow( | ||
<Home /> | ||
); | ||
expect(wrapper.find('.heading')).to.have.length(1); | ||
expect(wrapper.props()).to.have.property('children'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
|
||
/** | ||
* NotFound - renders a 404 page; | ||
* @returns {Object} React element to render | ||
*/ | ||
export default function NotFound() { | ||
return ( | ||
<div className="full-height flex-center position-ref"> | ||
<h1>404!</h1> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* global expect:true */ | ||
/* global shallow:true */ | ||
|
||
import React from 'react';//eslint-disable-line | ||
|
||
import NotFound from '../../src/components/static/NotFound.component.jsx'; | ||
|
||
describe('<NotFound />', () => { | ||
it('should have a heading text of h1', () => { | ||
const wrapper = shallow( | ||
<NotFound /> | ||
); | ||
expect(wrapper.find('h1')).to.have.length(1); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* global expect:true */ | ||
/* global shallow:true */ | ||
|
||
import React from 'react';//eslint-disable-line | ||
|
||
import Routes from '../../src/components/Routes.component.jsx'; | ||
|
||
describe('<Routes />', () => { | ||
it('should have the props for history and routes', () => { | ||
const wrapper = shallow(<Routes />); | ||
expect(wrapper.props()).to.have.property('history'); | ||
expect(wrapper.props()).to.have.property('routes'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const express = require('express'); | ||
const path = require('path'); | ||
const webpack = require('webpack'); | ||
|
||
const app = express(); | ||
|
||
const PORT = process.env.PORT || 7000; | ||
|
||
if (process.env.NODE_ENV !== 'test') { | ||
const webpackConfig = require('./webpack.config'); | ||
const webpackDevMiddleware = require('webpack-dev-middleware'); | ||
const webpackHotMiddleware = require('webpack-hot-middleware'); | ||
|
||
const compiler = webpack(webpackConfig); | ||
app.use(webpackDevMiddleware(compiler, { | ||
noInfo: true, | ||
publicPath: '/' | ||
})); | ||
app.use(webpackHotMiddleware(compiler)); | ||
} | ||
|
||
app.use(express.static(path.join(__dirname, '/dist/'))); | ||
|
||
app.get('/*', (req, res) => { | ||
res.sendFile(path.join(__dirname, '/dist/index.html')); | ||
}); | ||
|
||
app.listen(PORT, () => { | ||
console.info('==> 🌎 Listening on PORT %s.', PORT);// eslint-disable-line | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.full-height { | ||
height: 100vh; | ||
} | ||
|
||
.flex-center { | ||
align-items: center; | ||
display: flex; | ||
justify-content: center; | ||
} | ||
|
||
.position-ref { | ||
position: relative; | ||
} |
Oops, something went wrong.