Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cierrateam/nuxt-parse
A parse nuxtjs plugin
https://github.com/cierrateam/nuxt-parse
Last synced: 12 days ago
JSON representation
A parse nuxtjs plugin
- Host: GitHub
- URL: https://github.com/cierrateam/nuxt-parse
- Owner: cierrateam
- Created: 2019-07-16T21:22:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-26T05:22:28.000Z (7 months ago)
- Last Synced: 2024-04-26T06:27:39.797Z (7 months ago)
- Language: JavaScript
- Size: 3.48 MB
- Stars: 23
- Watchers: 1
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Parse package for Nuxt.js
[![CircleCI](https://circleci.com/gh/cierrateam/nuxt-parse/tree/master.svg?style=svg)](https://circleci.com/gh/cierrateam/nuxt-parse/tree/master)
![Cierra](https://img.shields.io/badge/Cierra-Open%20Source-orange.svg)
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/GeneaLabs/nova-map-marker-field/master/LICENSE)
![npm](https://img.shields.io/npm/dw/nuxt-parse)
![GitHub last commit (branch)](https://img.shields.io/github/last-commit/cierrateam/nuxt-parse/master)A parse module for Nuxt.js.
## Installation
```bash
$ yarn add nuxt-parse # or npm install
```Implement the module in `nuxt.config.js`:
```
...
modules: [
['nuxt-parse', {
appId: YOUR_APP_ID,
javascriptKey: YOUR_JAVASCRIPT_KEY,
serverUrl: OPTIONAL_SERVER_URL
}
]
],
...
```You don't have to provide the serverUrl if you're using the back4app service.
## Usage
To access the parse instance you can use `this.$parse` anywhere you want to. For example to login you can use:
```
this.$parse.User.logIn('username', 'password')
```## Middleware
To add the middleware to the client you can create a file called `middleware/auth.js` with the following content:
```
import Parse from 'parse';
export default function ({redirect}) {
// If the user is not authenticated
let currentUser = Parse.User.current();
if(!currentUser)
return redirect('/register');
}
```Then you're able to use the `middleware: 'auth'` option in your pages.
## Contributing
Please observe and respect all aspects of the included Code of Conduct .### Submitting Pull Requests
Please review the Contribution Guidelines . Only PRs that meet all criterium will be accepted.