1
0
mirror of https://github.com/oceanprotocol/webtasks synced 2025-01-08 21:04:03 +01:00

prototype Zoho proxy

This commit is contained in:
Matthias Kretschmann 2018-06-21 08:29:35 +02:00
parent 1c8795a27a
commit d9946926fa
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 24 additions and 1 deletions

View File

@ -3,11 +3,13 @@
"version": "0.1.0",
"private": true,
"scripts": {
"start": "wt serve webtask-medium.js",
"start": "wt serve webtask-zoho.js",
"test": "eslint ./{src,public}/**/*.js"
},
"dependencies": {
"cors": "^2.8.4",
"express": "^4.16.3",
"http-proxy-middleware": "^0.18.0",
"request": "^2.85.0",
"webtask-tools": "^3.2.0"
},

21
webtask-zoho.js Normal file
View File

@ -0,0 +1,21 @@
const express = require('express')
const Webtask = require('webtask-tools')
const cors = require('cors')
const proxy = require('http-proxy-middleware')
const server = express()
const config = {
target: 'https://www.zohoapis.com/crm/v2/',
changeOrigin: true,
headers: {
Authorization: 'Zoho-oauthtoken hello'
}
}
server.use(cors())
server.use('*', proxy(config))
server.listen(4430)
module.exports = Webtask.fromExpress(server)