Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zeusdeux/get-now-json
An endpoint that returns a now.json file based on passed query params.
https://github.com/zeusdeux/get-now-json
lambda now serverless typescript zeit zeit-now
Last synced: about 2 months ago
JSON representation
An endpoint that returns a now.json file based on passed query params.
- Host: GitHub
- URL: https://github.com/zeusdeux/get-now-json
- Owner: zeusdeux
- License: mit
- Created: 2018-12-23T23:08:36.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-27T23:27:08.000Z (about 6 years ago)
- Last Synced: 2024-10-31T11:43:13.980Z (3 months ago)
- Topics: lambda, now, serverless, typescript, zeit, zeit-now
- Language: TypeScript
- Homepage: https://now-json.zdx.cat
- Size: 69.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# get-now-json
An endpoint that returns a now.json file based on passed query params.
## Motivation
I wanted to setup some tooling for myself that makes it easy for me to scaffold out projects deployable to [zeit](https://zeit.co).
This lambda powers a set in that tooling.## Usage
Any [supported now.json config property](https://zeit.co/docs/v2/deployments/configuration/) can be passed as a query param with a value.
The `version` property is always set to `2` by default and can be overriden by a `version` query parameter.
### Important note
This project does **NO** validation of the json it outputs. That is delegated to the `now` CLI and occurs when it tries to consume the generated json config in the context of _your_ project.
### Examples
```curl
curl "https://now-json.zdx.cat" # returns { "version": 2, "public": false }
curl "https://now-json.zdx.cat?name=my-project" # returns { "version": 2, "public": false, "name": "my-project"}# returns the builds object wrapped in an array as expected by `now` cli
curl 'https://now-json.zdx.cat?name=my-project&builds=\{"src": "a.js", "use": "@now/node"\}'# these two return the same object with a builds array
curl 'https://now-json.zdx.cat?name=my-project&builds=\{"src": "a.js", "use": "@now/node"\}&builds=\{"src": "index.html", "use": "@now/static"\}'
curl 'https://now-json.zdx.cat?name=my-project&builds=\[\{"src": "a.js", "use": "@now/node"\},\{"src": "index.html", "use": "@now/static"\}\]'
```or if you want to try it in the browser, [click me!](https://now-json.zdx.cat/?name=my-project&builds={%22src%22:%20%22a.js%22,%20%22use%22:%20%22@now/node%22}&builds={%22src%22:%20%22index.html%22,%20%22use%22:%20%22@now/static%22})