-
Notifications
You must be signed in to change notification settings - Fork 10
Configuration
"Evernote REST Webapp" is built on "Spring Boot" and uses many infrastructure from it.
If you need to configure infrastructure related behavior, please also reference the Spring Boot Documentation.
application.properties
(or application.yml
) file is used for configuring application.
If application is started from executable war file (java -jar evernote-rest-webapp
) , it will search application.properties
file in this order:
- classpath root
- current directory
- classpath /config package
- /config subdir of the current directory.
Thus, place the application.properties
to one of the search path directories.
Please see more detail on Spring-Boot doc (see "Externalized Configuration" section).
When you are deploying the "Evernote REST Webapp" to a servlet container, you may need to specify external configuration file in different way.
One approach is to specify "spring.config.location" system property in your servlet container.
For example, in tomcat:
"CATALINA_HOME/bin/setenv.sh"
export CATALINA_OPTS="-Dspring.config.location=file:/usr/local/myapp/application.properties"
* The value of system property is evaluated as spring resource style format.
So, if you are specifying a file outside of classpath, you need to put "file:" prefix.
In application.properties
, you can specify these entries.
All "Evernote REST Webapp" related configurations start with evernote
.
"Consumer Key" provided by evernote.
Default: None
(Required)
Alias: evernote.consumer_key
"Consumer Secret" provided by evernote.
Default: None
(Required)
Alias: evernote.consumer_secret
Evernote servers.
Default: SANDBOX
Value: SANDBOX
, PRODUCTION
, or YINXIANG
Always use access token specified in config file.
When this is true, user specified access token in http header (evernote-rest-accesstoken
) will be ignored.
Mainly development purpose.
Default: false
Value: true
or false
Alias: evernote.always_use_token_from_config
You can specify your developer token.
Default: None
Alias: evernote.access_token
When http request doesn't provide access-token in header(evernote-rest-accesstoken
), use access-token from config.
Good for development.
Default: false
Value: true
or false
Alias: evernote.fallback_to_token_from_config
Set custom user agent to the evernote thrift call.
Default: None
Alias: evernote.user_agent
Set custom header values to the evernote thrift call.
Default: None
Value: Key-Value strings
Alias: evernote.custom_headers
Example:
evernote.customHeaders['foo']=FOO
evernote.custom_headers.bar=BAR
Spring Boot also provide many configuration entries. Here, list only part of them.
Please reference Spring Boot project for more detail.
This enables output json to be formatted.
Default: false
Value: true
or false
Alias: http.mappers.json_pretty_print
- "application.properties":
evernote.consumerKey=foo
evernote.consumerSecret=foo-secret
evernote.environment=SANDBOX
evernote.always_use_token_from_config=false
evernote.access_token=foo-access-token
evernote.fallback_to_token_from_config=true