{"_id":"5724e2904255580e005938b4","parentDoc":null,"version":{"_id":"5723eaebeae5090e00ee61f1","__v":3,"project":"5723ead0fda3c70e005b88e5","createdAt":"2016-04-29T23:14:51.190Z","releaseDate":"2016-04-29T23:14:51.190Z","categories":["5723eaebeae5090e00ee61f2","5723f854110e570e00486c7a","572a28f6d10a200e00b1cb14"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.1.0","version":"0.1"},"__v":17,"project":"5723ead0fda3c70e005b88e5","category":{"_id":"5723f854110e570e00486c7a","project":"5723ead0fda3c70e005b88e5","__v":0,"version":"5723eaebeae5090e00ee61f1","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-04-30T00:12:04.115Z","from_sync":false,"order":2,"slug":"http-api","title":"Reference"},"user":"5723ea8efda3c70e005b88e3","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-04-30T16:51:28.321Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"# :bookmark: `lever.json`\n\n`lever.json` is the configuration file provided as part of every Lever deployment. The simplest `lever.json` typically contains just the `name` of the serivce and an entry point (like `jsEntry`).\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"name\\\": \\\"exampleService\\\",\\n  \\\"jsEntry\\\": \\\"service.js\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"lever.json\"\n    }\n  ]\n}\n[/block]\nThe following describes in detail every JSON property that can be used to configure the service.\n\n### :hash: `name` (string)\n\nThe name of the service, the most important thing in `lever.json`. It is a string that needs to be unique within the Lever environment it is used. Any preexisting service with the same name will be overwritten when deploying. A couple of rules:\n\n* The name must have at least 3 and at most 255 characters.\n* It must not contain `/`, `?`, `#` or spaces.\n\n### :hash: `description` (string) *optional*\n\nA description of the service.\n\n### :hash: `entry` ([string]) *optional*\n\nThe binary entry point of the service. At most one of `entry` and `jsEntry` may be specified as part of `lever.json`. If none of the two is specified, then `entry` defaults to `[\"./serve\"]`.\n\nThe binary entry point represents the command and its arguments that needs to be executed to run the process that listens for Lever connections. For example, to run the command `./runService arg1 arg2`, you need to set this property to `[\"./runService\", \"arg1\", \"arg2\"]`.\n\n### :hash: `jsEntry` (string) *optional*\n\nThe JavaScript entry point of the service. At most one of `entry` and `jsEntry` may be specified as part of `lever.json`.\n\nThe JavaScript entry point represents the JS module that exports the Lever methods to be exposed as part of the service's API.\n\n### :hash: `private` (boolean) *optional*\n\nIndicates whether the service is private or public. If not specified, the service defaults to **public**.\n\nA **private** service can only be accessed by other Lever services *from the same environment*, via a client library. It is only meant as a backend. By contrast, a **public** service can also be accessed from outside the environment (either via a client library or via the [HTTP API](doc:http-api)).\n\n### :hash: `maxInstanceLoad` (number) *optional*\n\nThe maximum average load per instance of your service. If the total load of your service in a region exceeds this value times the number of instances already running, then Lever automatically starts more instances of this service.\n\nIf no value is specified, then `maxInstanceLoad` defaults to `10`.\n\nThe load is simply the number of requests *in flight* (currently being processed by the instances). For example, a service that takes about `1 second` to process each request and receives `5 requests/second`, then it has a load of `5`. Meaning that there are, on average, 5 requests being processed in parallel.\n\n### :hash: `minInstances` (integer) *optional*\n\n:construction: Not yet implemented. :construction:\n\n### :hash: `ram` (integer) *optional*\n\nThe amount of memory, in MB, to allocate for each instance. If not specified, `ram` defaults to `50`.\n\nNote that although memory is the most tangible resource being allocated with this configuration parameter, it is not the only one. CPU, network I/O and (in a future version) disk I/O is also controlled with this property, indirectly. These resources are allocated per instance proportionally to the amount of memory it reserves.\n\n### :hash: `config` (object) *optional*\n\n:construction: Not yet implemented. :construction:","excerpt":"This page describes the different configuration parameters of lever.json","slug":"lever-json","type":"basic","title":"lever.json"}

lever.json

This page describes the different configuration parameters of lever.json

# :bookmark: `lever.json` `lever.json` is the configuration file provided as part of every Lever deployment. The simplest `lever.json` typically contains just the `name` of the serivce and an entry point (like `jsEntry`). [block:code] { "codes": [ { "code": "{\n \"name\": \"exampleService\",\n \"jsEntry\": \"service.js\"\n}", "language": "json", "name": "lever.json" } ] } [/block] The following describes in detail every JSON property that can be used to configure the service. ### :hash: `name` (string) The name of the service, the most important thing in `lever.json`. It is a string that needs to be unique within the Lever environment it is used. Any preexisting service with the same name will be overwritten when deploying. A couple of rules: * The name must have at least 3 and at most 255 characters. * It must not contain `/`, `?`, `#` or spaces. ### :hash: `description` (string) *optional* A description of the service. ### :hash: `entry` ([string]) *optional* The binary entry point of the service. At most one of `entry` and `jsEntry` may be specified as part of `lever.json`. If none of the two is specified, then `entry` defaults to `["./serve"]`. The binary entry point represents the command and its arguments that needs to be executed to run the process that listens for Lever connections. For example, to run the command `./runService arg1 arg2`, you need to set this property to `["./runService", "arg1", "arg2"]`. ### :hash: `jsEntry` (string) *optional* The JavaScript entry point of the service. At most one of `entry` and `jsEntry` may be specified as part of `lever.json`. The JavaScript entry point represents the JS module that exports the Lever methods to be exposed as part of the service's API. ### :hash: `private` (boolean) *optional* Indicates whether the service is private or public. If not specified, the service defaults to **public**. A **private** service can only be accessed by other Lever services *from the same environment*, via a client library. It is only meant as a backend. By contrast, a **public** service can also be accessed from outside the environment (either via a client library or via the [HTTP API](doc:http-api)). ### :hash: `maxInstanceLoad` (number) *optional* The maximum average load per instance of your service. If the total load of your service in a region exceeds this value times the number of instances already running, then Lever automatically starts more instances of this service. If no value is specified, then `maxInstanceLoad` defaults to `10`. The load is simply the number of requests *in flight* (currently being processed by the instances). For example, a service that takes about `1 second` to process each request and receives `5 requests/second`, then it has a load of `5`. Meaning that there are, on average, 5 requests being processed in parallel. ### :hash: `minInstances` (integer) *optional* :construction: Not yet implemented. :construction: ### :hash: `ram` (integer) *optional* The amount of memory, in MB, to allocate for each instance. If not specified, `ram` defaults to `50`. Note that although memory is the most tangible resource being allocated with this configuration parameter, it is not the only one. CPU, network I/O and (in a future version) disk I/O is also controlled with this property, indirectly. These resources are allocated per instance proportionally to the amount of memory it reserves. ### :hash: `config` (object) *optional* :construction: Not yet implemented. :construction: