├── .editorconfig ├── .eslintrc.js ├── .gitignore ├── .prettierrc ├── README.md ├── assets ├── README.md └── variables.scss ├── components ├── Logo.vue ├── README.md └── VuetifyLogo.vue ├── jsconfig.json ├── layouts ├── README.md ├── admin.vue ├── default.vue └── error.vue ├── middleware └── README.md ├── nuxt.config.js ├── package-lock.json ├── package.json ├── pages ├── README.md ├── admin │ ├── dashboard.vue │ ├── index.vue │ └── posts │ │ ├── create-post.vue │ │ ├── edit-post │ │ └── _id.vue │ │ └── index.vue ├── index.vue └── posts │ └── _id.vue ├── plugins ├── README.md ├── api.js ├── html-decode.js ├── moment.js ├── vee-validate.js └── vue-quil-editor.js ├── screenshots ├── 1 - Home.jpg ├── 2 - Post.jpg ├── 3 - Admin Login.jpg ├── 4 - Admin Dashboard.jpg ├── 5 - Admin Posts.jpg ├── 6 - Admin Create Post.jpg └── 7 - Admin Edit Post.jpg ├── services ├── Api.js ├── AuthenticationService.js └── PostServices.js ├── static ├── README.md ├── favicon.ico ├── tech-reagan-avatar.jpg ├── v.png └── vuetify-logo.svg └── store ├── README.md └── index.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | browser: true, 5 | node: true 6 | }, 7 | parserOptions: { 8 | parser: 'babel-eslint' 9 | }, 10 | extends: [ 11 | '@nuxtjs', 12 | 'prettier', 13 | 'prettier/vue', 14 | 'plugin:prettier/recommended', 15 | 'plugin:nuxt/recommended' 16 | ], 17 | plugins: ['prettier'], 18 | // add your custom rules here 19 | rules: {} 20 | } 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Node template 3 | # Logs 4 | /logs 5 | *.log 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | 10 | # Runtime data 11 | pids 12 | *.pid 13 | *.seed 14 | *.pid.lock 15 | 16 | # Directory for instrumented libs generated by jscoverage/JSCover 17 | lib-cov 18 | 19 | # Coverage directory used by tools like istanbul 20 | coverage 21 | 22 | # nyc test coverage 23 | .nyc_output 24 | 25 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 26 | .grunt 27 | 28 | # Bower dependency directory (https://bower.io/) 29 | bower_components 30 | 31 | # node-waf configuration 32 | .lock-wscript 33 | 34 | # Compiled binary addons (https://nodejs.org/api/addons.html) 35 | build/Release 36 | 37 | # Dependency directories 38 | node_modules/ 39 | jspm_packages/ 40 | 41 | # TypeScript v1 declaration files 42 | typings/ 43 | 44 | # Optional npm cache directory 45 | .npm 46 | 47 | # Optional eslint cache 48 | .eslintcache 49 | 50 | # Optional REPL history 51 | .node_repl_history 52 | 53 | # Output of 'npm pack' 54 | *.tgz 55 | 56 | # Yarn Integrity file 57 | .yarn-integrity 58 | 59 | # dotenv environment variables file 60 | .env 61 | 62 | # parcel-bundler cache (https://parceljs.org/) 63 | .cache 64 | 65 | # next.js build output 66 | .next 67 | 68 | # nuxt.js build output 69 | .nuxt 70 | 71 | # Nuxt generate 72 | dist 73 | 74 | # vuepress build output 75 | .vuepress/dist 76 | 77 | # Serverless directories 78 | .serverless 79 | 80 | # IDE / Editor 81 | .idea 82 | 83 | # Service worker 84 | sw.* 85 | 86 | # macOS 87 | .DS_Store 88 | 89 | # Vim swap files 90 | *.swp 91 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "arrowParens": "always", 4 | "singleQuote": true, 5 | "endOfLine": "auto", 6 | "trailingComma": "none" 7 | } 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Blog App 2 | 3 | > Blog app built with vuejs & nuxtjs 4 | 5 | ## Backend API 6 | 7 | I built the backend api with nodejs [Blog API](https://github.com/techreagan/blog-api) 8 | 9 | ## Screenshots 10 | 11 | > Delete the screenshot folder if you download this code. 12 | 13 | ### Home Page (/) 14 | 15 | ![Screenshot](screenshots/1%20-%20Home.jpg) 16 | 17 | ### Post Page (/posts/:id) 18 | 19 | ![Screenshot](screenshots/2%20-%20Post.jpg) 20 | 21 | ### Admin Login (/admin) 22 | 23 | ![Screenshot](screenshots/3%20-%20Admin%20Login.jpg) 24 | 25 | ### Admin Dashboard (/admin/dasboard) 26 | 27 | ![Screenshot](screenshots/4%20-%20Admin%20Dashboard.jpg) 28 | 29 | ### Admin List Posts (/admin/posts) 30 | 31 | ![Screenshot](screenshots/5%20-%20Admin%20Posts.jpg) 32 | 33 | ### Admin Create Post (/admin/create-post) 34 | 35 | ![Screenshot](screenshots/6%20-%20Admin%20Create%20Post.jpg) 36 | 37 | ### Admin Edit Post (/admin/edit-post/:id) 38 | 39 | ![Screenshot](screenshots/7%20-%20Admin%20Edit%20Post.jpg) 40 | 41 | ## Build Setup 42 | 43 | ```bash 44 | # install dependencies 45 | $ npm install 46 | 47 | # serve with hot reload at localhost:3000 48 | $ npm run dev 49 | 50 | # build for production and launch server 51 | $ npm run build 52 | $ npm run start 53 | 54 | # generate static project 55 | $ npm run generate 56 | ``` 57 | 58 | For detailed explanation on how things work, check out [Nuxt.js docs](https://nuxtjs.org). 59 | 60 | ## License 61 | 62 | This project is licensed under the MIT License 63 | 64 | ## Developed by Reagan Ekhameye (Tech Reagan) 65 | 66 | Reach me on twitter [@techreagan](https://www.twitter.com/techreagan) 67 | -------------------------------------------------------------------------------- /assets/README.md: -------------------------------------------------------------------------------- 1 | # ASSETS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked). 8 | -------------------------------------------------------------------------------- /assets/variables.scss: -------------------------------------------------------------------------------- 1 | // Ref: https://github.com/nuxt-community/vuetify-module#customvariables 2 | // 3 | // The variables you want to modify 4 | // $font-size-root: 20px; 5 | $body-font-family: 'Raleway', sans-serif; 6 | $material-light: map-merge( 7 | $material-light, 8 | ( 9 | 'background': 10 | var(--v-background-base, map-get($material-light, 'background')) 11 | !important 12 | ) 13 | ); 14 | $material-dark: map-merge( 15 | $material-dark, 16 | ( 17 | 'background': 18 | var(--v-background-base, map-get($material-dark, 'background')) !important 19 | ) 20 | ); 21 | -------------------------------------------------------------------------------- /components/Logo.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 80 | -------------------------------------------------------------------------------- /components/README.md: -------------------------------------------------------------------------------- 1 | # COMPONENTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | The components directory contains your Vue.js Components. 6 | 7 | _Nuxt.js doesn't supercharge these components._ 8 | -------------------------------------------------------------------------------- /components/VuetifyLogo.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 19 | -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "paths": { 5 | "~/*": ["./*"], 6 | "@/*": ["./*"], 7 | "~~/*": ["./*"], 8 | "@@/*": ["./*"] 9 | } 10 | }, 11 | "exclude": ["node_modules", ".nuxt", "dist"] 12 | } 13 | -------------------------------------------------------------------------------- /layouts/README.md: -------------------------------------------------------------------------------- 1 | # LAYOUTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Application Layouts. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts). 8 | -------------------------------------------------------------------------------- /layouts/admin.vue: -------------------------------------------------------------------------------- 1 | 62 | 63 | 118 | -------------------------------------------------------------------------------- /layouts/default.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | 62 | 63 | 68 | -------------------------------------------------------------------------------- /layouts/error.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 39 | 40 | 45 | -------------------------------------------------------------------------------- /middleware/README.md: -------------------------------------------------------------------------------- 1 | # MIDDLEWARE 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your application middleware. 6 | Middleware let you define custom functions that can be run before rendering either a page or a group of pages. 7 | 8 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware). 9 | -------------------------------------------------------------------------------- /nuxt.config.js: -------------------------------------------------------------------------------- 1 | import colors from 'vuetify/es5/util/colors' 2 | 3 | export default { 4 | mode: 'universal', 5 | /* 6 | ** Headers of the page 7 | */ 8 | head: { 9 | titleTemplate: '%s - ' + process.env.npm_package_name, 10 | title: process.env.npm_package_name || '', 11 | meta: [ 12 | { charset: 'utf-8' }, 13 | { name: 'viewport', content: 'width=device-width, initial-scale=1' }, 14 | { 15 | hid: 'description', 16 | name: 'description', 17 | content: process.env.npm_package_description || '' 18 | } 19 | ], 20 | link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }] 21 | }, 22 | /* 23 | ** Customize the progress-bar color 24 | */ 25 | loading: { color: '#1976D2' }, 26 | /* 27 | ** Global CSS 28 | */ 29 | css: [ 30 | 'quill/dist/quill.core.css', 31 | // for snow theme 32 | 'quill/dist/quill.snow.css', 33 | // for bubble theme 34 | 'quill/dist/quill.bubble.css' 35 | ], 36 | /* 37 | ** Plugins to load before mounting the App 38 | */ 39 | plugins: [ 40 | { src: '@/plugins/html-decode.js' }, 41 | { src: '@/plugins/api.js', mode: 'all' }, 42 | { src: '@/plugins/vee-validate.js', mode: 'client' }, 43 | { src: '@/plugins/vue-quil-editor.js', ssr: false } 44 | ], 45 | /* 46 | ** Nuxt.js dev-modules 47 | */ 48 | buildModules: [ 49 | // Doc: https://github.com/nuxt-community/eslint-module 50 | '@nuxtjs/eslint-module', 51 | '@nuxtjs/vuetify' 52 | ], 53 | /* 54 | ** Nuxt.js modules 55 | */ 56 | modules: [ 57 | // Doc: https://axios.nuxtjs.org/usage 58 | '@nuxtjs/axios', 59 | // Doc: https://github.com/nuxt-community/dotenv-module 60 | '@nuxtjs/dotenv', 61 | '@nuxtjs/auth' 62 | ], 63 | /* 64 | ** Axios module configuration 65 | ** See https://axios.nuxtjs.org/options 66 | */ 67 | axios: { 68 | baseURL: `${process.env.VUE_APP_URL}/api/v1` 69 | }, 70 | auth: { 71 | strategies: { 72 | local: { 73 | endpoints: { 74 | login: { url: '/auth/login', method: 'post', propertyName: 'token' }, 75 | logout: { url: '/auth/logout', method: 'get' }, 76 | user: { url: '/auth/me', method: 'post', propertyName: 'data' } 77 | } 78 | // tokenRequired: true, 79 | // tokenType: 'bearer', 80 | // globalToken: true, 81 | // autoFetchUser: true 82 | } 83 | }, 84 | redirect: { 85 | login: '/admin', 86 | logout: '/admin', 87 | callback: '/admin', 88 | home: '/admin/dashboard' 89 | } 90 | }, 91 | router: { 92 | middleware: ['auth'] 93 | }, 94 | /* 95 | ** vuetify module configuration 96 | ** https://github.com/nuxt-community/vuetify-module 97 | */ 98 | vuetify: { 99 | customVariables: ['~/assets/variables.scss'], 100 | theme: { 101 | options: { 102 | customProperties: true 103 | }, 104 | dark: true, 105 | themes: { 106 | dark: { 107 | primary: colors.blue.darken2, 108 | accent: colors.grey.darken3, 109 | secondary: colors.amber.darken3, 110 | info: colors.teal.lighten1, 111 | warning: colors.amber.base, 112 | error: colors.deepOrange.accent4, 113 | success: colors.green.accent3, 114 | background: '#00a86b' 115 | }, 116 | light: { 117 | background: '#d0f0c0' 118 | } 119 | } 120 | } 121 | }, 122 | /* 123 | ** Build configuration 124 | */ 125 | build: { 126 | /* 127 | ** You can extend webpack config here 128 | */ 129 | transpile: ['vee-validate/dist/rules'], 130 | // plugins: [ 131 | // new webpack.ProvidePlugin({ 132 | // 'window.Quill': 'quill/dist/quill.js', 133 | // Quill: 'quill/dist/quill.js' 134 | // }) 135 | // ], 136 | extend(config, ctx) {} 137 | }, 138 | generate: { 139 | fallback: true 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "blog-nuxt", 3 | "version": "1.0.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "nuxt", 7 | "build": "nuxt build", 8 | "start": "nuxt start", 9 | "generate": "nuxt generate", 10 | "lint:js": "eslint --fix --ext .js,.vue --ignore-path .gitignore .", 11 | "lint": "npm run lint:js" 12 | }, 13 | "dependencies": { 14 | "@nuxtjs/auth": "^4.9.1", 15 | "@nuxtjs/axios": "^5.11.0", 16 | "@nuxtjs/dotenv": "^1.4.1", 17 | "dedent": "^0.7.0", 18 | "highlight.js": "^10.1.1", 19 | "lodash.debounce": "^4.0.8", 20 | "nuxt": "^2.13.0", 21 | "vee-validate": "^3.3.5", 22 | "vue-quill-editor": "^3.0.6" 23 | }, 24 | "devDependencies": { 25 | "@nuxtjs/eslint-config": "^3.0.0", 26 | "@nuxtjs/eslint-module": "^2.0.0", 27 | "@nuxtjs/vuetify": "^1.11.2", 28 | "babel-eslint": "^10.1.0", 29 | "eslint": "^7.2.0", 30 | "eslint-config-prettier": "^6.11.0", 31 | "eslint-plugin-nuxt": "^1.0.0", 32 | "eslint-plugin-prettier": "^3.1.4", 33 | "prettier": "^2.0.5" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /pages/README.md: -------------------------------------------------------------------------------- 1 | # PAGES 2 | 3 | This directory contains your Application Views and Routes. 4 | The framework reads all the `*.vue` files inside this directory and creates the router of your application. 5 | 6 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing). 7 | -------------------------------------------------------------------------------- /pages/admin/dashboard.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 20 | -------------------------------------------------------------------------------- /pages/admin/index.vue: -------------------------------------------------------------------------------- 1 | 51 | 52 | 88 | -------------------------------------------------------------------------------- /pages/admin/posts/create-post.vue: -------------------------------------------------------------------------------- 1 | 53 | 54 | 139 | 140 | 141 | -------------------------------------------------------------------------------- /pages/admin/posts/edit-post/_id.vue: -------------------------------------------------------------------------------- 1 | 54 | 55 | 191 | 192 | 193 | -------------------------------------------------------------------------------- /pages/admin/posts/index.vue: -------------------------------------------------------------------------------- 1 | 87 | 88 | 193 | -------------------------------------------------------------------------------- /pages/index.vue: -------------------------------------------------------------------------------- 1 | 67 | 68 | 119 | -------------------------------------------------------------------------------- /pages/posts/_id.vue: -------------------------------------------------------------------------------- 1 | 50 | 51 | 113 | -------------------------------------------------------------------------------- /plugins/README.md: -------------------------------------------------------------------------------- 1 | # PLUGINS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains Javascript plugins that you want to run before mounting the root Vue.js application. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/plugins). 8 | -------------------------------------------------------------------------------- /plugins/api.js: -------------------------------------------------------------------------------- 1 | import PostService from '../services/PostServices' 2 | 3 | export default ({ $axios }, inject) => { 4 | const api = { 5 | posts: PostService($axios) 6 | } 7 | 8 | inject('api', api) 9 | } 10 | -------------------------------------------------------------------------------- /plugins/html-decode.js: -------------------------------------------------------------------------------- 1 | export default (context, inject) => { 2 | const htmlDecode = (input) => { 3 | const e = document.createElement('div') 4 | e.innerHTML = input 5 | return e.childNodes.length === 0 ? '' : e.childNodes[0].nodeValue 6 | } 7 | 8 | inject('htmlDecode', htmlDecode) 9 | // context.$htmlDecode = htmlDecode 10 | } 11 | -------------------------------------------------------------------------------- /plugins/moment.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import moment from 'vue-quill-editor' 3 | 4 | Vue.use(moment) 5 | -------------------------------------------------------------------------------- /plugins/vee-validate.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import { required, min, numeric, length, email } from 'vee-validate/dist/rules' 3 | import { 4 | extend, 5 | ValidationObserver, 6 | ValidationProvider, 7 | setInteractionMode 8 | } from 'vee-validate' 9 | 10 | setInteractionMode('eager') 11 | 12 | extend('required', { 13 | ...required, 14 | message: 'Enter {_field_}' 15 | }) 16 | 17 | extend('email', { 18 | ...email, 19 | message: 'Email must be valid' 20 | }) 21 | 22 | extend('min', { 23 | ...min, 24 | message: '{_field_} may not be less than {length} characters' 25 | }) 26 | 27 | extend('length', { 28 | ...length, 29 | message: '{_field_} must be have at least {length} numbers' 30 | }) 31 | 32 | extend('numeric', { 33 | ...numeric, 34 | message: '{_field_} must be numeric' 35 | }) 36 | 37 | Vue.component('ValidationProvider', ValidationProvider) 38 | Vue.component('ValidationObserver', ValidationObserver) 39 | -------------------------------------------------------------------------------- /plugins/vue-quil-editor.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueQuillEditor from 'vue-quill-editor' 3 | 4 | Vue.use(VueQuillEditor) 5 | -------------------------------------------------------------------------------- /screenshots/1 - Home.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techreagan/blog-nuxtjs/a10beca1662ac1e521d48661111cc29232fdd4e3/screenshots/1 - Home.jpg -------------------------------------------------------------------------------- /screenshots/2 - Post.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techreagan/blog-nuxtjs/a10beca1662ac1e521d48661111cc29232fdd4e3/screenshots/2 - Post.jpg -------------------------------------------------------------------------------- /screenshots/3 - Admin Login.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techreagan/blog-nuxtjs/a10beca1662ac1e521d48661111cc29232fdd4e3/screenshots/3 - Admin Login.jpg -------------------------------------------------------------------------------- /screenshots/4 - Admin Dashboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techreagan/blog-nuxtjs/a10beca1662ac1e521d48661111cc29232fdd4e3/screenshots/4 - Admin Dashboard.jpg -------------------------------------------------------------------------------- /screenshots/5 - Admin Posts.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techreagan/blog-nuxtjs/a10beca1662ac1e521d48661111cc29232fdd4e3/screenshots/5 - Admin Posts.jpg -------------------------------------------------------------------------------- /screenshots/6 - Admin Create Post.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techreagan/blog-nuxtjs/a10beca1662ac1e521d48661111cc29232fdd4e3/screenshots/6 - Admin Create Post.jpg -------------------------------------------------------------------------------- /screenshots/7 - Admin Edit Post.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techreagan/blog-nuxtjs/a10beca1662ac1e521d48661111cc29232fdd4e3/screenshots/7 - Admin Edit Post.jpg -------------------------------------------------------------------------------- /services/Api.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | 3 | export default () => { 4 | const axiosInstance = axios.create({ 5 | baseURL: `${process.env.VUE_APP_URL}/api/v1` 6 | }) 7 | 8 | const token = localStorage.getItem('token') 9 | if (token) { 10 | axiosInstance.defaults.headers.common.Authorization = `Bearer ${token}` 11 | } 12 | 13 | axiosInstance.interceptors.response.use( 14 | (response) => response, 15 | (error) => { 16 | if (error.response.status === 401) { 17 | localStorage.removeItem('token') 18 | localStorage.removeItem('user') 19 | location.reload() 20 | } 21 | return Promise.reject(error) 22 | } 23 | ) 24 | 25 | return axiosInstance 26 | } 27 | -------------------------------------------------------------------------------- /services/AuthenticationService.js: -------------------------------------------------------------------------------- 1 | export default { 2 | signIn(credentials) { 3 | return Api().post('auth/login', credentials) 4 | }, 5 | signUp(data) { 6 | return Api().post('auth/register', data) 7 | }, 8 | updateUserDetails(data) { 9 | return Api().put('auth/updatedetails', data) 10 | }, 11 | uploadUserAvatar(data) { 12 | return Api().put('auth/avatar', data) 13 | }, 14 | updatePassword(data) { 15 | return Api().put('auth/updatepassword', data) 16 | }, 17 | me(token) { 18 | return Api().post('auth/me', { 19 | headers: { Authorization: `Bearer ${token}` } 20 | }) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /services/PostServices.js: -------------------------------------------------------------------------------- 1 | export default (axios) => ({ 2 | getPosts(params) { 3 | return axios.get('posts', { 4 | params 5 | }) 6 | }, 7 | getPost(id) { 8 | return axios.get(`posts/${id}`) 9 | }, 10 | updatePost(id, data) { 11 | return axios.put(`posts/${id}`, data) 12 | }, 13 | createPost(data) { 14 | return axios.post('posts', data) 15 | }, 16 | deletePost(id) { 17 | return axios.delete(`posts/${id}`) 18 | } 19 | }) 20 | -------------------------------------------------------------------------------- /static/README.md: -------------------------------------------------------------------------------- 1 | # STATIC 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your static files. 6 | Each file inside this directory is mapped to `/`. 7 | Thus you'd want to delete this README.md before deploying to production. 8 | 9 | Example: `/static/robots.txt` is mapped as `/robots.txt`. 10 | 11 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static). 12 | -------------------------------------------------------------------------------- /static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techreagan/blog-nuxtjs/a10beca1662ac1e521d48661111cc29232fdd4e3/static/favicon.ico -------------------------------------------------------------------------------- /static/tech-reagan-avatar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techreagan/blog-nuxtjs/a10beca1662ac1e521d48661111cc29232fdd4e3/static/tech-reagan-avatar.jpg -------------------------------------------------------------------------------- /static/v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techreagan/blog-nuxtjs/a10beca1662ac1e521d48661111cc29232fdd4e3/static/v.png -------------------------------------------------------------------------------- /static/vuetify-logo.svg: -------------------------------------------------------------------------------- 1 | Artboard 46 2 | -------------------------------------------------------------------------------- /store/README.md: -------------------------------------------------------------------------------- 1 | # STORE 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Vuex Store files. 6 | Vuex Store option is implemented in the Nuxt.js framework. 7 | 8 | Creating a file in this directory automatically activates the option in the framework. 9 | 10 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/vuex-store). 11 | -------------------------------------------------------------------------------- /store/index.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techreagan/blog-nuxtjs/a10beca1662ac1e521d48661111cc29232fdd4e3/store/index.js --------------------------------------------------------------------------------