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 user = require('../models/user') | |
var config = require('../config/keys') | |
const jwt = require('jsonwebtoken') | |
const passport = require('passport'); | |
module.exports.signup = function(req,res){ | |
var newUser = new user({ | |
email: req.body.email, | |
username: req.body.username, |
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 mongoose = require('mongoose'); | |
const Schema = mongoose.Schema; | |
const bcrypt = require('bcrypt-nodejs'); | |
const UserSchema = new Schema({ | |
email : { | |
type : String, | |
unique : true | |
}, | |
username: String, |
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
var AWS = require('aws-sdk') | |
var multer = require('multer') | |
var multerS3 = require('multer-s3') | |
AWS.config.loadFromPath('./s3_config.json') | |
var s3 = new AWS.S3() | |
var upload = multer({ | |
storage: multerS3({ | |
s3: s3, |
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
import Axios from 'axios' | |
state = { | |
todos : null | |
}, | |
getters = { | |
TODOS : state => { | |
return state.todos; | |
} | |
}, |
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
import Vue from 'vue' | |
import Vuex from 'vuex' | |
import Axios from 'axios' | |
import todos from './modules/todos' | |
Vue.use(Vuex); | |
export const store = new Vuex.Store({ | |
state: {}, |
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
import Vue from 'vue' | |
import Vuex from 'vuex' | |
import Axios from 'axios' | |
Vue.use(Vuex); | |
export const store = new Vuex.Store({ | |
state: { | |
todos : null | |
}, |
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
import Vue from 'vue' | |
import Vuex from 'vuex' | |
Vue.use(Vuex); | |
export const store = new Vuex.Store({ | |
state: {}, | |
getters : {}, | |
mutations: {}, | |
actions : {} |
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
mutations : { | |
SET_NAME : (state,name) => { | |
state.name = name | |
} | |
}, | |
actions : { | |
SET_NAME : async (context, name) => { | |
let { data } = await Axios.post('http://myapiendpoint.com/api/name',{name : name}) | |
if(data.status == 200){ | |
context.dispatch('SET_NAME', name) |
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
import Vue from 'vue' | |
import Vuex from 'vuex' | |
import Axios from 'axios' | |
Vue.use(Vuex); | |
export const store = new Vuex.Store({ | |
state : {}, | |
getters : {}, | |
mutations : {}, |
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
<template lang="html"> | |
<v-tooltip left> | |
<span slot="activator"> | |
<p class="grey--text text--darken-2"> | |
<b class="indigo--text" v-if="isMyHandle(chat.handle)">{{chat.handle}} :</b> | |
<b class="pink--text" v-else>Me :</b> | |
{{chat.message}} | |
</p> | |
</span> | |
<span>{{chat.created | moment("HH:MM, DD-MM-YY")}}</span> |
NewerOlder