Skip to content

Commit

Permalink
Lint readme
Browse files Browse the repository at this point in the history
  • Loading branch information
mornir committed Feb 2, 2021
1 parent a2cf47c commit 0eaff82
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ A frontend example in Vue.js and Nuxt.js for the Sanity.io e-commerce schema

🔗 [Read the blog post](https://www.sanity.io/blog/e-commerce-vue-nuxt-snipcart)

![Short animated preview of the app](https://public.sanity.io/github-assets/snipcart-for-github.gif "Logo Title Text 1")

![Short animated preview of the app](https://public.sanity.io/github-assets/snipcart-for-github.gif 'Logo Title Text 1')

## Quickstart on local

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

# serve with hot reload at localhost:3000
$ npm run dev
$ yarn run dev
```

Tips:

- Make sure you are running on http://localhost:3000. If not sanity and snipcart will fail due to CORS origins.
- Vue.js requires a recent Node version so if it fails on startup you might need an upgrade.

Expand All @@ -33,17 +33,20 @@ You're about five minutes away from running this example with your own data. You
Head back to this project and in `sanity.js` change the `projectId` and `dataset` values to the ones you found above

Tips:

- Remember to add CORS manage.sanity.io (ex. http://localhost:3000 to run locally)
- You can `sanity deploy` your editor to share it with others

## Install your own snipcart

- Go to http://snipcart.com
- Register and copy your API-key from snipcart
- In `nuxt.config.js` paste it into `data-api-key`
- In `nuxt.config.js` paste it into `data-api-key`
- Remember to add your domain/url in your Snicart settings (https://app.snipcart.com/dashboard/account/domains)

## Build production server or static project
``` bash

```bash
# build for production and launch server
$ npm run build
$ npm start
Expand All @@ -55,7 +58,7 @@ $ npm run generate
If you want to host this on Netlify, as a static build, follow [these steps](https://www.sanity.io/blog/tutorial-host-your-sanity-based-next-js-project-on-netlify#3-deploy-your-blog-on-netlify) while switching out the `generate` command above and changing the output directory from `out` to `dist`. Note: Nuxt is intended to run as a universal/isomorphic app and will make calls to the Sanity CDN.

The queries are by default limited to 100 items. This project is just an example, but
it is possible to expand it with pagination or forever-scroll. To get more items,
it is possible to expand it with pagination or forever-scroll. To get more items,
just add ex [0..1000] to the end of your query https://www.sanity.io/docs/data-store/query-cheat-sheet#slice-operations

For detailed explanations on how Nuxt.js work, checkout the [Nuxt.js docs](https://github.com/nuxt/nuxt.js).

0 comments on commit 0eaff82

Please sign in to comment.