We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fcefeb commit fb49bdbCopy full SHA for fb49bdb
server/server.js
@@ -188,6 +188,17 @@ app.delete(
188
(req, res) => res.status(200).json(res.locals.deleted)
189
);
190
191
+
192
+//if in production mode, statically serve everything in the build folder on the route '/dist'
193
+if (process.env.NODE_ENV == 'production'){
194
+ app.use('/dist', express.static(path.join(__dirname, '../dist')));
195
196
+// serve index.html on the route '/'
197
+ app.get('/', (req, res) => {
198
+ return res.status(200).sendFile(path.join(__dirname, '../index.html'));
199
+});
200
+}
201
202
app.get('/', function(req, res) {
203
res.send('Houston, Caret is in orbit!');
204
});
0 commit comments