OneBlink API CLI
Local Development
Once you have written your handlers and setup the required routes, you are able to serve you code locally using the CLI serve
command.
serve
Command
oneblink api serve
Options
--env
: optionally sets the environment to load environment variables from, defaults todev
. See Environment Variables for more information.--port
: optionally sets the port to use for server, defaults to3000
.--cwd
: optionally set the path to project, defaults to current working directory.
Examples
-
Serve routes and handlers using
test
environment variables on port2000
:oneblink api serve --env test --port 2000
BYO AWS Credentials
When running the OneBlink API CLI serve
command, AWS Credentials are retrieved and used to allow you to communicate with AWS with limited restrictions. If you require access to more AWS services than the defaults, OneBlink are able to provide you with AWS credentials that you can use during local development to mirror your deployed AWS privileges.
Configuration
The property awsProfile
can be added to your projects .blinkmrc.json
file, which will be use as AWS_PROFILE
variable only during local development.
{
"server": {
"awsProfile": "name-of-profile"
}
}
Follow these steps to setup an AWS Profile
-
Contact OneBlink for AWS credentials for development purposes. Ensure you notify us of any specific privileges you believe you may need.
-
Install the AWS CLI
-
Create an AWS Profile
-
Manually update your
.blinkmrc.json
file with theawsProfile
property