Skip to content

Commit

Permalink
馃殌 Issue sdras#12 Improved readme && netlify dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Eckhardt-D committed Aug 23, 2019
1 parent 1b68f1a commit 7ed2dee
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
27 changes: 24 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ Demo site is here: [E-Commerce Store](https://ecommerce-netlify.netlify.com/)
![screenshot of site](https://s3-us-west-2.amazonaws.com/s.cdpn.io/28963/ecommerce-screenshot.jpg "E-Commerce Netlify Site")

There are two articles explaining how this site is set up:
* Explanation of Netlify Functions and Stripe: [Let's Build a JAMstack E-Commerce Store with Netlify Functions](https://css-tricks.com/lets-build-a-jamstack-e-commerce-store-with-netlify-functions/)
* Explanation of dynamic routing in Nuxt for the individual product pages: [Creating Dynamic Routes in Nuxt Application](https://css-tricks.com/creating-dynamic-routes-in-a-nuxt-application/)

- Explanation of Netlify Functions and Stripe: [Let's Build a JAMstack E-Commerce Store with Netlify Functions](https://css-tricks.com/lets-build-a-jamstack-e-commerce-store-with-netlify-functions/)
- Explanation of dynamic routing in Nuxt for the individual product pages: [Creating Dynamic Routes in Nuxt Application](https://css-tricks.com/creating-dynamic-routes-in-a-nuxt-application/)

## Build Setup

``` bash
```bash
# install dependencies
$ yarn install

Expand All @@ -25,6 +26,26 @@ $ yarn start

# generate static project
$ yarn generate

# Run a local netlify dev server
$ netlify dev

# To install netlify cli
$ yarn add global netlify-cli
# or
$ npm install -g netlify-cli
```

Note that for the function to work, you'll need to get a Stripe secret key:

```bash
$ echo 'STRIPE_SECRET_KEY=<your-secret-key>' > .env
```

If you are going into production, you can add your environment variable in your Netlify project:

```
settings > Build & deploy > Environment
```

For detailed explanation on how things work, checkout [Nuxt.js docs](https://nuxtjs.org).
8 changes: 7 additions & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
[build]
functions = "functions"
functions = "functions"

[dev]
command = "yarn dev"
port = 3000

# If you're experiencing stripe issues check the readme.md

0 comments on commit 7ed2dee

Please sign in to comment.