This file contains 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 Footer from '../../components/Footer'; | |
import SideBar from '../../SideBar'; | |
import * as Actions from '../../../Actions'; |
This file contains 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 Footer from 'components/Footer'; | |
import SideBar from 'dafaultLayout/SideBar'; | |
import * as Actions from 'actions'; |
This file contains 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
resolve: { | |
root: [ | |
path.resolve('./container') | |
] | |
}, |
This file contains 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
path.resolve('/foo/bar', './baz'); | |
// Returns: '/foo/bar/baz' | |
path.resolve('/foo/bar', '/tmp/file/'); | |
// Returns: '/tmp/file' | |
path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif'); | |
// if the current working directory is /home/myself/node, | |
// this returns '/home/myself/node/wwwroot/static_files/gif/image.gif' |
This file contains 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
resolve: { | |
modules: [ | |
path.resolve('./container'), | |
path.resolve('./node_modules') | |
] | |
}, |
This file contains 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 webpack = require('webpack'); | |
var path = require('path'); | |
var BUILD_DIR = path.resolve(__dirname, '../public/js'); | |
var APP_DIR = path.resolve(__dirname, 'src/'); | |
var config = { | |
entry: APP_DIR + '/index.js', | |
output: { | |
path: BUILD_DIR, |
This file contains 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
// Install global dependence | |
npm install -g increase-memory-limit | |
// Run in root the project | |
increase-memory-limit |
This file contains 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
module.exports = { | |
up: (queryInterface, Sequelize) => { | |
const UsersTable = queryInterface.createTable('Users', { | |
id: { | |
allowNull: false, | |
autoIncrement: true, | |
primaryKey: true, | |
type: Sequelize.INTEGER, | |
}, | |
fullName: { |
This file contains 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 = sequelize.define('User', { | |
/* .... */ | |
}, { | |
// não adicionar os atributos (updatedAt, createdAt) | |
timestamps: false, | |
// não permite deletar do banco, mas inseri na coluna deletedAt a data da exclusão | |
// se o timestamps estiver ativado | |
paranoid: true, |
This file contains 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
// é o mesmo conceito para o banco de dados, um campo definido como chave primaria | |
// não pode ter dois ou mais registros de mesmo valor e também não pode ter valor nulo | |
primaryKey: true, | |
// habilita que o banco crie a coluna como auto incremente 1, 2, ..., n+1 | |
// registro 1, registro 2... | |
autoIncrement: true, | |
// o tipo de dados que vai ser armazenando no campo | |
type: Sequelize.INTEGER, |
OlderNewer