Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 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 (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-26T11:25:00.000Z (about 2 years ago)
- Last Synced: 2023-02-27T10:56:12.280Z (almost 2 years 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: 72
- Watchers: 4
- Forks: 18
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nuxt-netlify-functions-example
[![Netlify Status](https://api.netlify.com/api/v1/badges/ae375e95-eb24-46ed-95d3-a8591add95bc/deploy-status)](https://app.netlify.com/sites/nuxt-netlify-functions-example/deploys)
[![GitHub Actions](https://img.shields.io/github/workflow/status/wearelucid/nuxt-netlify-functions-example/End-to-end%20tests?label=build&logo=github&style=for-the-badge)](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
```