{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • Microgateway /
avatar image
1
Question by Kyle Labbe · Sep 22, 2017 at 03:32 PM · 112 Views javascriptmicrogatewaytargetendpointtarget endpoint

Javascript not running on local microgateway to overwrite target.url,TargetEndPoint override not working

I am trying to write an API proxy that will query a service discovery tool and route to a dynamic end point based on the result of the query.

This is the example i am following for the endpoint rewrite: http://docs.apigee.com/api-services/reference/javascript-policy

That seems to work when i hit the URL in the example: curl -i -H 'Content-Type: application/x-www-form-urlencoded'-X POST -d 'user=Will' http://myorg-test.apigee.net/js-example

But when I try to test my local micro gateway (which pulls in this example code from the Edge UI) the javascript doesn't seem to run and it always hits the default URL. This is what i am hitting locally curl -i -H 'Content-Type: application/x-www-form-urlencoded'-X POST -d 'user=Will' http://localhost:8000/js-example

Are there any settings that need to be enabled locally to allow javascript to run?

Comment
Add comment Show 1
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Dino ♦♦   · Sep 22, 2017 at 05:08 PM 0
Link

Hey @Srinandan Sridhar

Would you like to address this question?

Close

1 Answer

  • Sort: 
avatar image
1
Best Answer

Answer by srinandans · Sep 22, 2017 at 05:42 PM

@Kyle Labbe

hmmm, yes, It can be a bit confusing for someone who is familiar with the API Proxy model, but ... Microgateway does not use any policies defined in the API Proxy (including JavaScript). All logic that runs in the microgateway is delivered via "plugins". Please refer here for how to write a custom plugin: http://docs.apigee.com/microgateway/latest/develop-custom-plugins

Plugins are configured (enabled or disabled) in the config.yaml file.

Comment
Add comment Show 1 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Kyle Labbe · Sep 22, 2017 at 07:04 PM 0
Link

Thank you, that explains why I was seeing that behavior. I will review the plugin documentation and try implementing my service that way.

Follow this Question

Answers Answers and Comments

51 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Microgateway and Apigee plugins 1 Answer

How to access headers added using AssignMessage policy in Microgateway custom plugin 1 Answer

Microgateway Target URL with Query Parameters 1 Answer

Specify different throttling limits for Micro aware proxies? 1 Answer

Edge Gateway vs Microgateway,Apigee Edge vs Microgateway 4 Answers

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2019 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Members
  • Badges