Code Monkey home page Code Monkey logo

netlify-feature-tour's Introduction

Netlify examples

Netlify Feature Tour

Access this demo site: https://feature-tour.netlify.app

Netlify Status

About this example site

This site provides a path to get started learning about Netlify features.

Speedily deploy your own version

Deploy your own version of this example site by selecting the Deploy to Netlify Button below. This will automatically:

  • Clone a copy of this repo to your own GitHub account
  • Create a new project in your Netlify account, linked to your new repo
  • Create an automated deployment pipeline to watch for changes on your repo
  • Build and deploy your new site

Deploy To Netlify

Install and run this example locally

You can clone this example repo to explore its features and implementation and to run it locally.

# 1. Clone the repository to your local development environment
git clone [email protected]:netlify/feature-tour.git

# 2. Move into the project directory
cd feature-tour

# 3. Install code dependencies
npm install

# 4. Install the Netlify CLI to let you locally serve your site using Netlify's features
npm install -g netlify-cli

# 5. Serve your site using Netlify Dev
netlify dev

netlify-feature-tour's People

Contributors

akardet avatar jlengstorf avatar khendrikse avatar philhawksworth avatar rstavchansky avatar ryanbonial avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

netlify-feature-tour's Issues

Demo issue

Update netlify-feature-tour for example purposes.

Serverless function demo not working locally as described

TL;DR

Serverless functions may not run in netlify dev mode without additional setup not currently specified in the feature tour docs.

Details

๐Ÿ‘‹ Howdy, Netlify friends!

I just went through this repo in preparation for a chat with the Netlify dev team tomorrow and got a bit stuck with the Create Your First Serverless Function section of the demo. Specifically, I was able to deploy and get a serverless function running in production but not locally (i.e. using netlify dev on my machine).

Unless I'm missing something (definitely possible, given my rusty JS chops!), it seems like these instructions on the Netlify Functions page may need a bit of tweaking:

Save it, then run netlify dev to test locally.
Check your work by clicking the button below!

When I create the function and run netlify dev on my machine as instructed, then click Test Your Function, I get the following error:

image

In the local server logs, I'm seeing:

โ—ˆ Starting Netlify Dev with Astro

> @example/[email protected] dev
> astro dev

[19:29:41] [snowpack] Hint: run "snowpack init" to create a project config file. Using defaults...
[19:29:41] [snowpack] Ready!
[19:29:41] [snowpack] watching for file changes... 
[dev server] Server started in 383ms.
[dev server] Local: http://localhost:3000/
[access] /.netlify/functions/hello-world
[access] /404
[access] Not Found: /.netlify/functions/hello-world
โ ผ Waiting for framework port 3000. This can be configured using the 'targetPort' property in the netlify.toml

curl-ing the function endpoint directly doesn't seem to be working either:

$ curl localhost:3000/.netlify/functions/hello-world
Not Found%    

I played around with different filenames and paths for a bit before deciding to deploy to production to see if I could break my site there. However, to my surprise, the exact same code worked in prod:

image

Unlike in dev, in production, curl-ing the function endpoint works as expected:

$ curl https://MY-SUBDOMAIN.netlify.app/.netlify/functions/hello-world
hello world!%

In case it helps, here's a screenshot of the function I wrote (simple copy-pasta from the instructions) as well as its location within my project:

image

I'm guessing that there must be some additional setup needed to spark the /.netlify path magic and get functions running locally. It could be great if you could update the repo to include instructions on how to do that - or at least remove the suggestion to try running functions locally so anxious candidates like me don't tear more hair out than necessary ๐Ÿ˜…

[security] Enforce Branch Protections

This is an issue generated by (for-internal-use-only)github-tools

Description

This repository has exceeded the development grace period, and the repo owner must decide if branch protections should be enforced.
If this repository houses code used in production in any capacity, branch protections must be enforced. Read (for-internal-use-only)here for more details

What do I need to do?

  • You can control whether or not branch protections are enforced by exclusively creating either of the labels:
    'enforce-branch-protections: true' or 'enforce-branch-protections: false'
  • If there is no branch protection control label, this issue will be recreated.
  • Once you have created either label, you can close this issue.
  • If you have issues or questions, please reach out to #internal-security-n-compliance on slack.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.