-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding my updated files and new file versions
- Loading branch information
1 parent
1589a3a
commit 4174648
Showing
43 changed files
with
117,032 additions
and
116,888 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) [Year] [Your Name] | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
MIT License | ||
Copyright (c) [Year] [Your Name] | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
# StudyPlanner | ||
|
||
A brief description of your project, its purpose, and functionality. | ||
|
||
## Features | ||
|
||
- List of features | ||
- Key functionalities of your application | ||
|
||
## Getting Started | ||
|
||
### Prerequisites | ||
|
||
- Node.js | ||
- MongoDB | ||
- Any other dependencies | ||
|
||
### Installation | ||
|
||
Provide step-by-step instructions on setting up the project locally. | ||
|
||
```bash | ||
git clone https://github.com/yourusername/StudyPlanner.git | ||
cd StudyPlanner | ||
npm install | ||
# StudyPlanner | ||
|
||
A brief description of your project, its purpose, and functionality. | ||
|
||
## Features | ||
|
||
- List of features | ||
- Key functionalities of your application | ||
|
||
## Getting Started | ||
|
||
### Prerequisites | ||
|
||
- Node.js | ||
- MongoDB | ||
- Any other dependencies | ||
|
||
### Installation | ||
|
||
Provide step-by-step instructions on setting up the project locally. | ||
|
||
```bash | ||
git clone https://github.com/yourusername/StudyPlanner.git | ||
cd StudyPlanner | ||
npm install |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
# Security Policy | ||
|
||
## Supported Versions | ||
|
||
Use this section to tell people about which versions of your project are | ||
currently being supported with security updates. | ||
|
||
| Version | Supported | | ||
| ------- | ------------------ | | ||
| 5.1.x | :white_check_mark: | | ||
| 5.0.x | :x: | | ||
| 4.0.x | :white_check_mark: | | ||
| < 4.0 | :x: | | ||
|
||
## Reporting a Vulnerability | ||
|
||
Use this section to tell people how to report a vulnerability. | ||
|
||
Tell them where to go, how often they can expect to get an update on a | ||
reported vulnerability, what to expect if the vulnerability is accepted or | ||
declined, etc. | ||
# Security Policy | ||
|
||
## Supported Versions | ||
|
||
Use this section to tell people about which versions of your project are | ||
currently being supported with security updates. | ||
|
||
| Version | Supported | | ||
| ------- | ------------------ | | ||
| 5.1.x | :white_check_mark: | | ||
| 5.0.x | :x: | | ||
| 4.0.x | :white_check_mark: | | ||
| < 4.0 | :x: | | ||
|
||
## Reporting a Vulnerability | ||
|
||
Use this section to tell people how to report a vulnerability. | ||
|
||
Tell them where to go, how often they can expect to get an update on a | ||
reported vulnerability, what to expect if the vulnerability is accepted or | ||
declined, etc. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,37 @@ | ||
{ | ||
"// FILEPATH": "/c:/Users/teami/StudyPlanner/app.js", | ||
"// BEGIN: ed8c6549bwf9": "", | ||
"dependencies": { | ||
"cors": "^2.8.5" | ||
}, | ||
"// END: ed8c6549bwf9": "" | ||
} | ||
const morgan = require('morgan'); | ||
|
||
|
||
const express = require('express'); | ||
const cors = require('cors'); | ||
const morgan = require('morgan'); // Add this line | ||
|
||
const app = express(); | ||
|
||
const port = process.env.PORT || 3000; | ||
|
||
// Middleware to parse JSON and urlencoded data | ||
app.use(express.json()); | ||
app.use(express.urlencoded({ extended: true | ||
})); | ||
|
||
// Enable CORS | ||
app.use(cors()); | ||
|
||
// Morgan for logging HTTP requests | ||
app.use(morgan('dev')); | ||
|
||
// Load environment variables | ||
require('dotenv').config(); | ||
|
||
// Sample root route for basic testing | ||
app.get('/', (req, res) => { | ||
res.send('Hello, StudyPlanner!'); | ||
}); | ||
|
||
// Task routes | ||
const taskRoutes = [ | ||
// Define your task routes here | ||
]; | ||
|
||
app.use('/api/tasks', taskRoutes); | ||
|
||
// Global error handling middleware | ||
app.use((err, req, res, next) => { | ||
console.error(err.stack); // Log the error stack for debugging | ||
res.status(500).send('Something broke!'); | ||
}); | ||
|
||
// Start the server | ||
app.listen(port, () => { | ||
console.log(`StudyPlanner app listening at http: //localhost:${process.env.PORT || 3000}`); | ||
}); | ||
|
||
|
||
|
||
|
||
|
||
require('dotenv').config(); | ||
const express = require('express'); | ||
const cors = require('cors'); | ||
const morgan = require('morgan'); | ||
const helmet = require('helmet'); | ||
|
||
const app = express(); | ||
const port = process.env.PORT || 3000; | ||
|
||
// Middleware for parsing JSON and urlencoded data | ||
app.use(express.json()); | ||
app.use(express.urlencoded({ extended: true })); | ||
|
||
// Enable CORS for all routes | ||
app.use(cors()); | ||
|
||
// Helmet for security by setting various HTTP headers | ||
app.use(helmet()); | ||
|
||
// Morgan for logging HTTP requests | ||
app.use(morgan('tiny')); | ||
|
||
// Global error handler for uncaught exceptions and unhandled promise rejections | ||
process.on('uncaughtException', (error) => { | ||
console.error(`Uncaught Exception: ${error.message}`); | ||
process.exit(1); | ||
}); | ||
|
||
process.on('unhandledRejection', (error) => { | ||
console.error(`Unhandled Rejection: ${error.message}`); | ||
}); | ||
|
||
// Starting the server | ||
app.listen(port, () => { | ||
console.log(`Server is running on port ${port}`); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"version": "0.2", | ||
"ignorePaths": [], | ||
"dictionaryDefinitions": [], | ||
"dictionaries": [], | ||
"words": [], | ||
"ignoreWords": [], | ||
"import": [] | ||
} | ||
{ | ||
"version": "0.2", | ||
"ignorePaths": [], | ||
"dictionaryDefinitions": [], | ||
"dictionaries": [], | ||
"words": [], | ||
"ignoreWords": [], | ||
"import": [] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"enabled": true | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"name": "mongodb-atlas", | ||
"type": "mongodb-atlas", | ||
"config": { | ||
"clusterName": "StudyPlannerCluster", | ||
"readPreference": "primary", | ||
"wireProtocolEnabled": false | ||
}, | ||
"version": 1 | ||
} | ||
{ | ||
"name": "mongodb-atlas", | ||
"type": "mongodb-atlas", | ||
"config": { | ||
"clusterName": "StudyPlannerCluster", | ||
"readPreference": "primary", | ||
"wireProtocolEnabled": false | ||
}, | ||
"version": 1 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
{ | ||
"id": "655dac9fccee7c038194a679", | ||
"roles": [ | ||
{ | ||
"name": "read-not-write", | ||
"apply_when": {}, | ||
"document_filters": { | ||
"write": false, | ||
"read": true | ||
}, | ||
"read": true, | ||
"write": false, | ||
"insert": true, | ||
"delete": true, | ||
"search": true | ||
} | ||
] | ||
} | ||
{ | ||
"id": "655dac9fccee7c038194a679", | ||
"roles": [ | ||
{ | ||
"name": "read-not-write", | ||
"apply_when": {}, | ||
"document_filters": { | ||
"write": false, | ||
"read": true | ||
}, | ||
"read": true, | ||
"write": false, | ||
"insert": true, | ||
"delete": true, | ||
"search": true | ||
} | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{} | ||
{} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
{ | ||
"collection": "Item", | ||
"database": "todo", | ||
"roles": [ | ||
{ | ||
"name": "write-own-items", | ||
"apply_when": {}, | ||
"document_filters": { | ||
"write": { | ||
"owner_id": "%%user.id" | ||
}, | ||
"read": true | ||
}, | ||
"read": true, | ||
"write": true, | ||
"insert": true, | ||
"delete": true, | ||
"search": true | ||
} | ||
] | ||
} | ||
{ | ||
"collection": "Item", | ||
"database": "todo", | ||
"roles": [ | ||
{ | ||
"name": "write-own-items", | ||
"apply_when": {}, | ||
"document_filters": { | ||
"write": { | ||
"owner_id": "%%user.id" | ||
}, | ||
"read": true | ||
}, | ||
"read": true, | ||
"write": true, | ||
"insert": true, | ||
"delete": true, | ||
"search": true | ||
} | ||
] | ||
} |
Oops, something went wrong.