Junaidb commited on
Commit
8fa094b
·
verified ·
1 Parent(s): 4c669c4

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +11 -25
index.js CHANGED
@@ -1,5 +1,4 @@
1
  import express from 'express';
2
- import { PinataSDK } from "pinata";
3
 
4
 
5
 
@@ -41,38 +40,23 @@ async function getToken(){
41
 
42
 
43
 
44
- async function getRuntime() {
45
-
46
- const { jwt, gateway } = await getcreds();
47
- const pinata = new PinataSDK({ pinataJwt: jwt, pinataGateway: gateway });
48
-
49
-
50
-
51
- const client = provideClient();
52
- return { pinata, client };
53
-
54
- }
55
-
56
-
57
-
58
-
59
 
60
 
 
61
 
 
 
 
62
 
63
 
64
 
65
 
66
 
67
- //Routes
68
 
69
- app.get('/', (req, res) => {
70
- res.json({ status: 'ok' });
71
- });
72
 
73
 
74
 
75
- app.get('/hft',(req,res)=>{
76
 
77
 
78
  let result=await getToken()
@@ -83,13 +67,15 @@ app.get('/hft',(req,res)=>{
83
 
84
 
85
 
 
86
 
87
-
88
- app.post('/route', (req, res) => {
89
- const { name, value } = req.body;
90
- res.json({ success: true });
91
  });
92
 
 
 
93
  // Start
94
 
95
  app.listen(7860, () => console.log('server running on port 7860'));
 
1
  import express from 'express';
 
2
 
3
 
4
 
 
40
 
41
 
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
 
45
+ //Routes
46
 
47
+ app.get('/', (req, res) => {
48
+ res.json({ status: 'ok' });
49
+ });
50
 
51
 
52
 
53
 
54
 
 
55
 
 
 
 
56
 
57
 
58
 
59
+ app.get('/hft',async (req,res)=>{
60
 
61
 
62
  let result=await getToken()
 
67
 
68
 
69
 
70
+ app.get('/creds',async (req,res)=>{
71
 
72
+ let result=await getcreds()
73
+ res.json({"jwt":result.jwt,"gateway":result.gateway})
74
+
 
75
  });
76
 
77
+
78
+
79
  // Start
80
 
81
  app.listen(7860, () => console.log('server running on port 7860'));