Skip to content
This repository was archived by the owner on Mar 17, 2019. It is now read-only.

Commit 6e78d5c

Browse files
committed
Added CORS header and changed domain
1 parent 61259d0 commit 6e78d5c

File tree

4 files changed

+111
-71
lines changed

4 files changed

+111
-71
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Created by .ignore support plugin (hsz.mobi)

.idea/workspace.xml

Lines changed: 107 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ const PRICING = {
6969
};
7070

7171
http.createServer((req, res) => {
72+
res.setHeader('Access-Control-Allow-Origin', '*');
7273
if (req.url === '/submit-order' && req.method.toUpperCase() === 'POST') {
7374
const form = formidable.IncomingForm();
7475
form.uploadDir = __dirname + '/temp/';
@@ -88,7 +89,7 @@ http.createServer((req, res) => {
8889
[
8990
fields.name,
9091
fields.date,
91-
"https://fathomless-chamber-47185.herokuapp.com/" + files.file.path.replace(/\/app/g, ''),
92+
"https://inked-out.herokuapp.com/" + files.file.path.replace(/\/app/g, ''),
9293
fields.size,
9394
fields.email,
9495
fields.quantity
@@ -100,7 +101,7 @@ http.createServer((req, res) => {
100101
res.end(error);
101102
return;
102103
}
103-
res.end('Updated ' + response.updatedCells + ' cells for order');
104+
res.end('200: Order recorded in Google Sheets');
104105
});
105106
});
106107
} else {

0 commit comments

Comments
 (0)