Skip to content

Commit

Permalink
fs
Browse files Browse the repository at this point in the history
  • Loading branch information
iarinaval committed Aug 1, 2018
1 parent b528e96 commit c028b8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion controllers/cooperative_controller.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var express = require('express')
const express = require('express')
, router = express.Router();

const coopModel = require("../models/cooperative_model");
Expand Down
14 changes: 9 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
let express = require('express');
let app = express();
let bodyParser = require('body-parser');
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const fs = require('fs');


app.set('view engine', 'ejs');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.static(__dirname + "/public"));
app.use(require("./middlewares/auth"));
app.use(require("./controllers/cooperative_controller"));
app.use(require("./controllers/guichet_controller"));

const controllers_files = fs.readdirSync('./controllers');
controllers_files.forEach((controller) => {
app.use(require("./controllers/" + controller));
});

app.listen(8060);

0 comments on commit c028b8e

Please sign in to comment.