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
version: '3' | |
services: | |
frontend: | |
# image: node:9.11 | |
container_name: "frontend" | |
build: ./frontend/ | |
ports: | |
- 8888:3000 | |
volumes: |
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
FROM node:9.11 | |
MAINTAINER itto-ki | |
RUN npm install -g express-generator | |
USER node | |
ENV HOME /home/node | |
RUN mkdir $HOME/project | |
WORKDIR $HOME/project |
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
FROM node:9.11 | |
MAINTAINER itto-ki | |
RUN npm install -g create-react-app yarn | |
USER node | |
ENV HOME /home/node | |
RUN mkdir $HOME/project | |
WORKDIR $HOME/project |
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
{ | |
"name": "project", | |
"version": "0.0.0", | |
"private": true, | |
"scripts": { | |
"start": "nodemon ./bin/www" | |
}, | |
"dependencies": { | |
"cookie-parser": "~1.4.3", | |
"debug": "~2.6.9", |
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 mongoose = require('mongoose'); | |
var Schema = mongoose.Schema; | |
var Article = new Schema({ | |
title: String, | |
content: String, | |
created_at: { | |
type: Date, | |
default: Date.now | |
}, |
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 express = require('express'); | |
var router = express.Router(); | |
var ArticleModel = require('../db/articleModel.js'); | |
router.get('/', function(req, res, next) { | |
ArticleModel | |
.find() | |
.then(function(users) { | |
res.json(users); | |
}); |
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 createError = require('http-errors'); | |
var express = require('express'); | |
var path = require('path'); | |
var cookieParser = require('cookie-parser'); | |
var logger = require('morgan'); | |
var mongoose = require('mongoose') | |
var indexRouter = require('./routes/index'); | |
var articlesRouter = require('./routes/articles'); |
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 React from 'react' | |
import ReactDOM from 'react-dom' | |
import { Provider } from 'react-redux' | |
import { compose, createStore, applyMiddleware } from 'redux' | |
import { createBrowserHistory } from 'history' | |
import { connectRouter, routerMiddleware } from 'connected-react-router' | |
import createSagaMiddleware from 'redux-saga' | |
import rootReducer from './reducers' | |
import App from './components/App' | |
import apiSaga from './sagas/saga' |
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 React from 'react' | |
import { ConnectedRouter } from 'connected-react-router' | |
import { Route, Switch } from 'react-router-dom' | |
import TopBar from './TopBar' | |
import ArticleList from '../containers/ArticleList' | |
import Creator from '../containers/Creator' | |
const App = ({history}) => ( | |
<div> | |
<ConnectedRouter history={history}> |
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 { push} from 'connected-react-router' | |
import { call, put, takeEvery } from 'redux-saga/effects' | |
import { getUrl, postUrl } from './api' | |
import { | |
ARTICLES_FETCH_REQUESTED, | |
ARTICLES_FETCH_SUCCEEDED, | |
ARTICLES_FETCH_FAILED, | |
ARTICLE_FETCH_REQUESTED, | |
ARTICLE_FETCH_SUCCEEDED, | |
ARTICLE_FETCH_FAILED, |
OlderNewer