Skip to content

Commit

Permalink
Merge pull request #368 from Open-Science-Community-Saudi-Arabia/fix_…
Browse files Browse the repository at this point in the history
…documentation

Fix documentation and removed redundant code files.
  • Loading branch information
sandygudie authored May 14, 2024
2 parents 07e7938 + eee6bf8 commit a7357aa
Show file tree
Hide file tree
Showing 37 changed files with 1,550 additions and 2,121 deletions.
55 changes: 48 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,6 @@ vignettes/*.pdf
# R Environment Variables
.Renviron

# Backend API sensitive files
/API/src/.env*
/API/src/.env
/API/src/.env.dev
/API/src/.env.test
/API/src/seeders/config.js
*node_modules/

# History files
.Rhistory
Expand Down Expand Up @@ -130,3 +123,51 @@ todo
/documentation/docs/fonts
/documentation/docs/img
/documentation/docs/scripts

# Backend files
/API/src/.env*
/API/src/.env
/API/src/.env.dev
/API/src/.env.test
/API/src/seeders/config.js
*node_modules/


# Client files
/client/src/.env*
/client/src/.env
/client/src/.env.dev
/client/src/.env.test
/client/src/.env.local

*node_modules/

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# misc
.DS_Store
.env*
.env.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
21 changes: 8 additions & 13 deletions API/src/app.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
const express = require("express");
const morgan = require("morgan");
const cors = require('cors');
require('express-async-errors')
const cookieParser = require('cookie-parser')
const cors = require("cors");
require("express-async-errors");
const cookieParser = require("cookie-parser");
const errorHandler = require("./middlewares/error_handler");
const app = express();
const session = require("express-session");
const UUID = require("uuid").v4;

// Middlewares
if (process.env.NODE_ENV == "dev") app.use(morgan("dev"));
app.use(cors())
app.use(cors());
app.use(cookieParser());
app.use(express.json());

// Route handler
require("./routes/routes_handler")(app);

// Error handler middleware
app.use(errorHandler);
app.use((req, res, next) => {
res.status(404).json({
status: "fail",
message: `Can't find ${req.originalUrl} on this server!`,
});
res.status(404).json({
status: "fail",
message: `Can't find ${req.originalUrl} on this server!`,
});
});

module.exports = app;
Loading

0 comments on commit a7357aa

Please sign in to comment.