{
	"name": "FireIde.API.Run.Spawn",
	"Web.Endpoint": "POST /run",
	"json": {
		"@set(package)": {
			"@FireIde.Core.Package.Load": null
		},
		"@if(package.name)": {
			"@set(spawned)": {
				"@FireIde.Core.Run.BindSocketIO": {
					"@FireIde.Core.ChildProcess.Spawn": {
						"cmd": "firejs",
						"args": [
								"package.json"
							],
						"logPathPrefix": {
							"@concat": [
								"/tmp/",
								{
									"@get(package.name)": null
								}
							]
						}
					}
				}
			},
			"@return": {
				"id": {
					"@get(spawned.id)": null
				}
			}
		},
		"@unless": {
			"@Web.Response.Status": 422,
			"@return": "No application name found in package.json"
		}
	}
}