Skip to content

Commit ed8fc6f

Browse files
author
Alex Patterson
committed
add buildtime config
1 parent 30cab41 commit ed8fc6f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

next.config.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,19 @@ const nextConfig = {
1919
};
2020

2121
const withTypescript = require('@zeit/next-typescript');
22+
23+
const prodConfig = {
24+
API_ENDPOINT: 'https://us-central1-ajonp-ajs-books.cloudfunctions.net/api/'
25+
};
26+
27+
const devConfig = {
28+
API_ENDPOINT: 'http://localhost:5001/ajonp-ajs-books/us-central1/api/'
29+
};
30+
2231
module.exports = withTypescript(
2332
{
24-
target: 'serverless'
33+
target: 'serverless',
34+
env: process.env.NODE_ENV === 'production' ? prodConfig : devConfig
2535
},
2636
withBundleAnalyzer(nextConfig)
2737
);

0 commit comments

Comments
 (0)