Closed amanjeev closed 4 years ago
Hi!
You do not have "app_path" which points to API directory. And default Tyk config (if you have followed installation steps) contains it https://github.com/TykTechnologies/tyk/blob/master/install/data/tyk.self_contained.conf
After adding it, it should start working.
Cheers!
@buger Thanks! Do I need to add a similar path for policies?
Yep, like this:
"policies": {
"policy_source": "file",
"policy_record_name": "policies/policies.json"
},
@buger Your docs say
If Tyk is being used in its standard configuration (CE Mode), then API definitions are stored in the apps folder (by default in /opt/tyk-gateway/apps). This file is scanned for files that ending in .json extension and interpreted at startup or reload. See the API Management section of the Tyk Gateway REST API for more details.
That to me looked as if, if not supplied the detfault is /opt/tyk-gateway/apps
which is where I have my JSON files.
Yeah, it more meant "default" config
Branch/Environment/Version
Describe the bug
Creation of APIs using the file system, by putting files in
/apps
directory. This is based on the documentation:Community Edition
Tutorial: Create an API in File-based Mode
Reproduction steps Steps to reproduce the behavior:
Toggle to see API JSON
/opt/tyk-gateway/apps/
and check the file is there with the correct content.Test API
listed in the output.Actual behavior
The API is not listed, and does not exist in Tyk Gateway.
Expected behavior
We expect to see the API in the list of APIs returned via the
/tyk/apis
endpoint.Additional context
However, when we use the Tyk's
/tyk/apis
endpoint to create the same APIs, they are created fine.Tyk Config
Toggle to see API JSON
``` { "enable_hashed_keys_listing": true, "allow_insecure_configs": true, "allow_master_keys": false, "allow_remote_config": true, "control_api_hostname": "", "disable_dashboard_zeroconf": false, "disable_virtual_path_blobs": false, "enable_analytics": false, "enable_api_segregation": false, "enable_bundle_downloader": true, "enable_coprocess": false, "enable_custom_domains": true, "enable_jsvm": true, "enable_non_transactional_rate_limiter": true, "enable_sentinel_rate_limiter": false, "enable_separate_cache_store": false, "enforce_org_data_age": true, "enforce_org_data_detail_logging": false, "enforce_org_quotas": true, "event_trigers_defunct": {}, "experimental_process_org_off_thread": false, "hash_keys": true, "health_check": { "enable_health_checks": false, "health_check_value_timeouts": 60 }, "hide_generator_header": false, "hostname": "", "http_server_options": { "certificates": [], "enable_websockets": true, "flush_interval": 0, "min_version": 0, "override_defaults": false, "read_timeout": 0, "server_name": "MYSERVERIP", "use_ssl": false, "use_ssl_le": false, "write_timeout": 0 }, "listen_port": 8080, "local_session_cache": { "cached_session_eviction": 0, "cached_session_timeout": 0, "disable_cached_session_state": true }, "max_idle_connections_per_host": 500, "middleware_path": "./middleware", "node_secret": "secret", "oauth_redirect_uri_separator": ";", "oauth_refresh_token_expire": 0, "oauth_token_expire": 0, "optimisations_use_async_session_write": true, "pid_file_location": "./tyk-gateway.pid", "public_key_path": "", "secret": "secret", "sentry_code": "", "service_discovery": { "default_cache_timeout": 0 }, "slave_options": { "api_key": "", "bind_to_slugs": false, "connection_string": "", "disable_keyspace_sync": false, "enable_rpc_cache": false, "group_id": "", "rpc_key": "", "use_rpc": false }, "storage": { "database": 0, "enable_cluster": false, "host": "tyk-redis", "hosts": null, "optimisation_max_active": 5000, "optimisation_max_idle": 3000, "password": "", "port": 6379, "type": "redis", "username": "" }, "suppress_default_org_store": false, "suppress_redis_signal_reload": false, "syslog_network_addr": "", "syslog_transport": "", "template_path": "./templates", "uptime_tests": { "config": { "checker_pool_size": 50, "enable_uptime_analytics": false, "failure_trigger_sample_size": 1, "time_wait": 2 }, "disable": true }, "use_graylog": false, "use_logstash": false, "use_redis_log": true, "use_sentry": false, "use_syslog": false } ```