Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Commit

Permalink
API paths are now prefixed with basename
Browse files Browse the repository at this point in the history
  • Loading branch information
phiilu committed Jan 17, 2018
1 parent 17f7430 commit 1cec121
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ app.use(bodyParser.json());
app.use(morgan("dev"));
app.use(helmet());

app.use("/api", apiLimiter, api);
if (base.endsWith("/")) {
app.use(base + "api", apiLimiter, api);
} else {
app.use(base + "/api", apiLimiter, api);
}

if (process.env.NODE_ENV === "production") {
app.use(base, Express.static(path.resolve("client", "build")));
Expand Down

0 comments on commit 1cec121

Please sign in to comment.