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
Part 1 : Config Server | |
// ไฟล์ src/server/server.js | |
1. import ไฟล์ตามนี้ | |
const createMemoryHistory = require('react-router/lib/createMemoryHistory'); | |
const configureStore = require('../common/stores').default; | |
const { syncHistoryWithStore } = require('react-router-redux'); | |
const { RouterContext, match } = require('react-router'); |
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
// main.js | |
const nodemailer = require('nodemailer'); | |
// setup mail transporter service | |
const transporter = nodemailer.createTransport({ | |
service: 'hotmail', | |
auth: { | |
user: 'yourmail@hotmail.com', // your email | |
pass: 'password' // your password | |
} |
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
//generator.js | |
// import chance instance | |
const chance = require('chance').Chance() | |
// customer object data | |
let customerid = 0 | |
const createCustomer = () => { | |
customerid++ | |
return { |
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 generator | |
const generator = require('./generator') | |
module.exports = () => ({ | |
customers: generator.customers(50), // create 50 customers | |
companies: generator.companies(50), // create 50 companies | |
}) |