This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path') | |
const CopyWebpackPlugin = require('copy-webpack-plugin') | |
const { execSync } = require('child_process') | |
process.env.VUE_APP_VERSION = require('./package.json').version | |
process.env.VUE_APP_GIT_BRANCH = process.env.CI_BRANCH || execSync('git rev-parse --abbrev-ref HEAD').toString('utf8').trim() | |
module.exports = { | |
outputDir: 'public', | |
assetsDir: 'static', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
url | method | description | |
---|---|---|---|
/user | GET | retrieves logged user infos | |
/user | PUT | modifies logged user infos | |
/user | DELETE | deconnects current user and deletes it | |
/user | POST | creates a new user (no need to be logged in) | |
/user/login | POST | submits user's credentials and logs in if succeeded | |
/user/logout | POST | deconnects curent user | |
/todos | GET | retrieve all todos for the current user | |
/todos/id | GET | retrieves data for a single todo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** VUEX module for todos management in todolist app **/ | |
export default { | |
namespaced: true, | |
// ----------------------------------------------------------------- | |
state: { | |
// properties to store todos data | |
}, | |
// ----------------------------------------------------------------- | |
getters: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** VUEX store definition file for todo list app **/ | |
import Vue from 'vue' | |
import Vuex from 'vuex' | |
import userModule from './userModule' | |
import todosModule from './todosModule' | |
Vue.use(Vuex) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get logged in user infos : | |
const user = this.$store.getters['user/data'] | |
// register a new user to the backend : | |
this.$store.dispatch('user/create', newUser) | |
// modify a todo : | |
this.$store.dispatch('todos/update', modifiedTodo) | |
// etc... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"data": { | |
"id": "5a6f5029d0eea73a41398812", | |
"type": "image", | |
"title": "My image", | |
"timestamps": { | |
"created": "2018-02-19 13:20:00", | |
"uploaded": "2018-02-19 13:20:00", | |
"modified": "2018-02-19 13:20:00" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** VUEX module for image asset management **/ | |
import Vue from 'vue' | |
export default { | |
namespaced: true, | |
// ----------------------------------------------------------------- | |
state: { | |
asset: {} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** VUEX module for image asset management **/ | |
import Vue from 'vue' | |
export default { | |
namespaced: true, | |
// ----------------------------------------------------------------- | |
state: { | |
asset: {} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** VUEX module for image asset management **/ | |
import Vue from 'vue' | |
export default { | |
namespaced: true, | |
// ----------------------------------------------------------------- | |
state: { | |
asset: {} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const originalSlot = this.$store.getters['asset/slot']('original') | |
originalSlot.public_url = 'some new url' | |
this.$store.commit('asset/setSlot', this.originalSlot) |
OlderNewer