Skip to content

Commit

Permalink
- fix for api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Benny Ogidan authored and Benny Ogidan committed Jan 4, 2018
1 parent ff0b1f1 commit 2ccda7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/src/app/components/hoc/UserRoutes.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react';
import React from 'react';
import { PropTypes } from 'prop-types';
import { Redirect, Route } from 'react-router-dom';
import { connect } from 'react-redux';
Expand Down
6 changes: 5 additions & 1 deletion server/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));

app.use('apidocs', express.static(path.join(__dirname, '../../apidocs')));
app.use('/apidocs', express.static(path.join(__dirname, '../../apidocs')));
app.use(express.static(path.join(__dirname, '../../client/dist/app')));

app.use((req, res, next) => {
Expand All @@ -32,6 +32,10 @@ app.use((req, res, next) => {

app.use('/api/v1', authenticateRoutes, routes);

app.get('/apidocs', (req, res) => {
res.sendFile(path.join(__dirname, '../../apidocs/index.html'));
});

app
.get('*', (req, res) =>
res.sendFile(path.join(__dirname, '../../client/dist/app/index.html')));
Expand Down

0 comments on commit 2ccda7f

Please sign in to comment.