parent
d28cb5a9ed
commit
f47a31d6d5
19 changed files with 229 additions and 149 deletions
@ -0,0 +1 @@ |
||||
alias vim='vi' |
@ -0,0 +1 @@ |
||||
set nocompatible |
@ -0,0 +1,3 @@ |
||||
{ |
||||
"CurrentProjectSetting": null |
||||
} |
@ -0,0 +1,6 @@ |
||||
{ |
||||
"ExpandedNodes": [ |
||||
"" |
||||
], |
||||
"PreviewInSolutionExplorer": false |
||||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,6 @@ |
||||
const config = { |
||||
PORT: 5000,
|
||||
DATABASE_URL: , |
||||
} |
||||
|
||||
export default config; |
@ -0,0 +1,18 @@ |
||||
export const EApplicationEnvironment = Object.freeze({ |
||||
DEVELOPMENT: 'development', |
||||
PRODUCTION: 'production', |
||||
}) |
||||
|
||||
export const task = Object.freeze({ |
||||
PRIORITY:{ |
||||
HIGH: "High", |
||||
MEDIUM: "Medium", |
||||
LOW: "Low", |
||||
}, |
||||
|
||||
STATUS:{ |
||||
TODO: "To do", |
||||
IN_PROGRESS: "In progress", |
||||
DONE: "Done!", |
||||
} |
||||
}) |
@ -0,0 +1,14 @@ |
||||
import { response } from "express"; |
||||
import { task } from "../constants/application"; |
||||
import database_service from "../services/database_service"; |
||||
|
||||
export default{ |
||||
self:(req,res)=>{ |
||||
try{ |
||||
return res.status(200).json({success: true, message: "Successfully done!"}) |
||||
|
||||
} catch(e) { |
||||
return res.status(500).json({success: false, message: "Not successfully done!"}) |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,23 @@ |
||||
import express from 'express'; |
||||
import cors from 'cors'; |
||||
import config from './config/config.js'; |
||||
import database_service from './services/database_service.js'; |
||||
import router from './router/router.js'; |
||||
|
||||
const App = express();
|
||||
App.use(express.json()); |
||||
App.use(cors()); |
||||
|
||||
const onListening = () => { |
||||
console.log(`Server is listening on port ${config.PORT}`); |
||||
|
||||
} |
||||
|
||||
database_service.connect() |
||||
.then( () => { |
||||
App.listen(config.PORT, onListening); |
||||
}).catch( (e) => { |
||||
console.log(`The error is ${e}`); |
||||
}) |
||||
|
||||
App.use("/api/variant1", router); |
@ -0,0 +1,8 @@ |
||||
import mongoose from "mongoose"; |
||||
import config from "../config/config"; |
||||
|
||||
export default{ |
||||
connect:async() => { |
||||
|
||||
} |
||||
} |
Loading…
Reference in new issue