Sfoglia il codice sorgente

Set headers for backend

Tatiana Inama 6 anni fa
parent
commit
20c22758b0
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 5 1
      src/Admin.tsx

+ 5 - 1
src/Admin.tsx

@@ -131,7 +131,11 @@ class Admin extends React.Component<{}, AdminState> {
     const canvas = new PaperScope();
     canvas.setup('vom-admin-canvas');
     canvas.view.viewSize.height = canvas.view.size.width * 1.25;
-    Axios.get<Result[]>(BACKEND).then(response => {
+    Axios.get<Result[]>(BACKEND, {
+      headers: {
+        'X-Token': 'secret-potato',
+      }
+    }).then(response => {
       const _data = response.data.map((result, index) => {
         return {
           ...result,