Skip to content

Commit 0099b1f

Browse files
init
1 parent fd592a1 commit 0099b1f

File tree

8 files changed

+1201
-0
lines changed

8 files changed

+1201
-0
lines changed

.sequelizerc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const {resolve} = require('path');
2+
3+
module.exports = {
4+
config: resolve(_dirname, 'src', 'config', 'database.js'),
5+
'models-path': resolve(_dirname, 'src', 'app', 'migrations'),
6+
'seeders-path': resolve(_dirname, 'src', 'database', 'seeds'),
7+
};

nodemon.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"execMap": {
3+
"js": "sucrase-node"
4+
}
5+
}

package.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "REACT_BLOG",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"license": "MIT",
6+
"scripts": {
7+
"dev": "nodemon src/server.js"
8+
},
9+
"devDependencies": {
10+
"nodemon": "^2.0.6",
11+
"sucrase": "^3.16.0"
12+
},
13+
"dependencies": {
14+
"pg": "^8.5.1",
15+
"pg-hstore": "^2.3.3",
16+
"sequelize": "^6.3.5"
17+
}
18+
}

src/app.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import express from 'express';
2+
import routes from 'routes';
3+
4+
class App{
5+
constructor(){
6+
this.server = express;
7+
this.middlewares();
8+
this.routes();
9+
}
10+
11+
middlewares(){
12+
13+
}
14+
15+
routes(){
16+
this.server.use(routes);
17+
}
18+
19+
}
20+
21+
export default App;

src/config/database.js

Whitespace-only changes.

src/route.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import {routes} from 'express';
2+
3+
const routes = new Router();
4+
5+
export default routes;

src/server.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import app from './app';
2+
3+
app.listen(3333);

0 commit comments

Comments
 (0)