https://github.com/wearelucid/nuxt-netlify-functions-example
Nuxt.js example for running Netlify functions locally in a dev environment and as a generated static site deployed to Netlify
https://github.com/wearelucid/nuxt-netlify-functions-example
axios netlify netlify-functions netlify-lambda nuxt-axios nuxt-demo nuxt-proxy nuxtjs vuejs
Last synced: 2 months ago
JSON representation
Nuxt.js example for running Netlify functions locally in a dev environment and as a generated static site deployed to Netlify
- Host: GitHub
- URL: https://github.com/wearelucid/nuxt-netlify-functions-example
- Owner: wearelucid
- License: mit
- Created: 2019-02-02T14:47:09.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T08:57:56.000Z (over 2 years ago)
- Last Synced: 2025-03-23T10:51:10.680Z (3 months ago)
- Topics: axios, netlify, netlify-functions, netlify-lambda, nuxt-axios, nuxt-demo, nuxt-proxy, nuxtjs, vuejs
- Language: Vue
- Homepage: https://nuxt-netlify-functions-example.netlify.com/
- Size: 3.6 MB
- Stars: 70
- Watchers: 5
- Forks: 19
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nuxt-netlify-functions-example
[](https://app.netlify.com/sites/nuxt-netlify-functions-example/deploys)
[](https://github.com/wearelucid/nuxt-netlify-functions-example)> Nuxt.js example for running Netlify functions locally in a dev environment and as a generated static site deployed to Netlify.
> Heavily inspired by the [official guide](https://functions-playground.netlify.com/) and [this example](https://github.com/stefanjudis/service-party).
## Demo
Live demo can be found [here](https://nuxt-netlify-functions-example.netlify.com/).
## Testing functions locally
Thanks to the [Netlify Dev](https://www.netlify.com/products/dev/) command in the Netlify CLI (`yarn global add netlify-cli`), you can test your functions locally with no build step involved!
After building the app and running `netlify dev` or `ntl dev`, you can test the functions locally by hitting the endpoint http://localhost:8888/.netlify/functions/
## Build Setup
```bash
# Use Node version specified in nvmrc
$ nvm use# Install dependencies
$ yarn# Serve Nuxt app and Netlify functions at localhost:8888
$ netlify dev# Generate static project
$ yarn generate
```## Running Tests
Tests use the Netlify CLI to run the serverless functions locally. You'll probably be prompted to login with your Netlify account.
```bash
# Serve Nuxt app and Netlify functions at localhost:8888
$ netlify dev# Run this command in another terminal
$ yarn test
```