auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
/*
This workflow returns a custom response to HTTP requests.
When you load the endpoint, this workflow will:
1. Get the latest position of the International
Space Station (ISS) using the Open Notify API
2. Return an HTTP 302 redirect to Google Maps with a pin showing the latest position of the ISS
To try it out, just load the endpoint URL in your browser. For the public demo workflow, the URL is:
https://en3nw7js9dhm37a.m.pipedream.net
If you copy this workflow, the URL will change.
NOTE: The data for this workflow is public. Any data you send
(including your IP address, user agent, etc) will be public.
To simply inspect executions, select events at the left. Or copy
and run a private copy of this workflow.
*/
async
params => {
}
const config = {
method: params.method,
url: params.url,
params: params.query,
headers: params.headers,
responseType: params.responseType,
data: params.data,
}
if (params.auth) config.auth = params.auth
return await require("@pipedreamhq/platform").axios(this, config)
auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
// construct and return the URL to view the position on Google Maps
return `http://www.google.com/maps/place/${steps.get_iss_position.$return_value.iss_position.latitude},${steps.get_iss_position.$return_value.iss_position.longitude}/@${steps.get_iss_position.$return_value.iss_position.latitude},${steps.get_iss_position.$return_value.iss_position.longitude},1z`
auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps) => {
}
// We'll use $respond() to return an HTTP 302 response
return await $respond({
status: 302,
immediate: true,
headers: {
location: steps.google_maps_url.$return_value
}
})