Advertisement
Shell_Casing

server

Dec 15th, 2018
1,075
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. app.get('/api', async (req, res, next) => {
  2.     const options = {
  3.         headers: { 'Authorization': config.API.access_token }
  4.     };
  5.  
  6.     let response = await fetch(config.API.url, options);
  7.     let historianData = await response.json();
  8.     console.log(historianData);     // deactivate when client is ready
  9.     res.send(historianData);        // activate when client is ready
  10.     next();
  11. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement