Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

Add autocomplete for functions templates #37

Merged
merged 3 commits into from
Mar 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ USAGE
OPTIONS
-c, --cmd=cmd command to run
-d, --devport=devport port of the dev server started by command
-d, --dir=dir dir with static files
-f, --functions=functions Specify a functions folder to serve
-o, --offline disables any features that require network access
-p, --port=port port of netlify dev
Expand Down Expand Up @@ -69,14 +68,13 @@ The order of precedence for applying redirect rules is:

See the [Redirects Documentation](https://www.netlify.com/docs/redirects/) for more information on Netlify's redirect and proxying capabilities.


#### Running the project and accessing redirects

```bash
# Build, serve and hot-reload changes
$ netlify dev
```


### Project detection

Netlify Dev will attempt to detect the SSG or build command that you are using, and run these on your behalf, while adding other development utilities.
Expand All @@ -91,14 +89,13 @@ The number of project types which Netlify Dev can detect is growing, but if your

```


### Netlify Functions

Netlify can also create serverless functions for you locally as part of Netlify Functions. The serverless functions can then be run by Netlify Dev in the same way that wold be when deployed to the cloud.

A number of function templates are available to get you started, and you can add your own utility functions to suit your own project development needs.

Create a new function
Create a new function

```bash
$ netlify functions:create
Expand All @@ -113,13 +110,9 @@ $ netlify functions:create

# Create a new function with a given name
$ netlify functions:create hello-world
# or
# or
$ netlify functions:create --name hello-world

# Create a new function in a subdirectory
# rather than as a single file
$ netlify functions:create hello-world --dir

# Create a new function by cloning a template from a remote url
# organised with dependencies installed into a subdirectory
$ netlify functions:create hello-world --url https://github.com/netlify-labs/all-the-functions/tree/master/functions/9-using-middleware
Expand All @@ -136,7 +129,6 @@ $ netlify dev

Each serverless function will be exposed on a URL corresponding to its path and file name.


`./functions/hello-world.js` -> `http://localhost:{PORT}/.netlify/functions/hello-world`

`./functions/my-api/hello-world.js` -> `http://localhost:{PORT}/.netlify/functions/my-api/hello-world`
70 changes: 31 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
"ascii-table": "0.0.9",
"copy-template-dir": "^1.4.0",
"fs-extra": "^7.0.1",
"fuzzy": "^0.1.3",
"get-port": "^4.1.0",
"http-proxy": "^1.17.0",
"inquirer": "^6.2.2",
"inquirer-autocomplete-prompt": "^1.0.1",
"netlify": "ssh+git://[email protected]:netlify/js-client-private",
"netlify-rules-proxy": "git+ssh://[email protected]/netlify/netlify-rules-proxy.git",
"node-fetch": "^2.3.0",
Expand Down
Loading