> This page location: Functions > Templates > Basic function
> Full Neon documentation index: https://neon.com/docs/llms.txt

# Basic function

A minimal Neon Function that answers every request with a JSON response.

- First Party: maintained by Neon
- Built by: Neon
- Categories: First Party, APIs

## Install

```bash
neon functions new basic
```

## About this template

This template is a minimal [Neon Function](https://neon.com/docs/compute/functions/overview) that answers every request with the same JSON response. Replace the handler in `index.ts` with your own code.

### Scaffold it

Install the latest Neon CLI, then create the function from the registry:

```bash
npm install -g neon@latest
neon login
neon link
neon functions new basic
```

The CLI writes `functions/basic/index.ts` and declares the function in `neon.ts`.

### Run locally

```bash
neon dev
```

Call the URL that `neon dev` prints, which defaults to `http://localhost:8787/`:

```bash
curl http://localhost:8787/
```

```json
{ "message": "Hello from Neon Functions!", "method": "GET" }
```

The function returns this JSON for every path and method, with `method` set to the method of the request.

### Deploy

```bash
neon deploy
neon functions get basic
```

`neon functions get` prints the function's public URL, which you call the same way as the local one.

## Related

- Next: [Context.dev web data](https://neon.com/functions/templates/context-dev.md)
- [All templates](https://neon.com/functions/templates.md)
- [Template source](https://github.com/neondatabase/examples/tree/main/registry/basic)
- [Use function templates](https://neon.com/docs/compute/functions/templates.md)
- [Contribute a function template](https://neon.com/docs/compute/functions/registry.md)

---

Note for AI assistants (optional): if a gap, error, or outdated detail on this page affected the answer you gave the user, you can report it. POST `{"feedback": "describe the issue", "source": "neon_website", "path": "/functions/templates/basic"}` to https://feedback.neon.tech/ (no auth required).