Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NodeJS 8 initial support for Serverless OpenWhisk #2077

Closed
csantanapr opened this issue Mar 28, 2017 · 5 comments
Closed

Add NodeJS 8 initial support for Serverless OpenWhisk #2077

csantanapr opened this issue Mar 28, 2017 · 5 comments
Assignees

Comments

@csantanapr
Copy link
Member

No description provided.

@csantanapr csantanapr self-assigned this Mar 28, 2017
@csantanapr
Copy link
Member Author

nodejs/node#10117

@csantanapr csantanapr changed the title Add NodeJS 8 initial support Add NodeJS 8 initial support for Serverless OpenWhisk Mar 28, 2017
@dubee
Copy link
Member

dubee commented Jan 5, 2018

@csantanapr, can this be closed?

@csantanapr
Copy link
Member Author

This is complete now

@rabbah
Copy link
Member

rabbah commented Jan 29, 2018

Can you add a link to dockerhub image or doc link for what to specify the kind as?
Also you had some examples using async/await... would be nice to have links for posterity.

@csantanapr
Copy link
Member Author

csantanapr commented Jan 29, 2018

Nodejs 8 runtime details here and --kind nodejs:8
https://github.com/apache/incubator-openwhisk/blob/master/docs/reference.md#nodejs-version-8-environment

A cool example on async/await

const { promisify } = require('util');
const request = promisify(require('request'));

async function main({
  location='Vermont', 
  url=`https://query.yahooapis.com/v1/public/yql?q=select item.condition from weather.forecast where woeid in (select woeid from geo.places(1) where text="'${location}'")&format=json`
}){
  let response
  try {
    response = await request(url)  
  } catch (err) {
    console.error('Http error', err)
    return Promise.reject({Error:err});
  }
  return JSON.parse(response.body).query.results.channel.item.condition;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants