Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A2 #15

Closed
wants to merge 4 commits into from
Closed

A2 #15

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ name: CI
on:
pull_request:
branches: [ main ]
pull_request_target:
branches:
- main


jobs:

Expand Down
11 changes: 11 additions & 0 deletions DatabaseConnection/connection.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
const Sequelize=require('sequelize');
const dotenv=require('dotenv');
const mysql=require('mysql2/promise');
dotenv.config();
const db = await mysql.createConnection({
host: process.env.DBHOST,
port: process.env.DBPORT,
user: process.env.DBUSER,
password: process.env.DBPASSWORD
});

await db.query(`CREATE DATABASE IF NOT EXISTS \$${database}\;`);

await db.end();
const sequelize = new Sequelize(process.env.DBNAME,process.env.DBUSER,process.env.DBPASSWORD,{
dialect:'mysql',
host:process.env.DBHOST,
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
# webapp
# webapp

## Bootstrapping Database



## Authentication


## APIs To Implement


## Implement Continuous Integration (CI) with GitHub Actions
6 changes: 3 additions & 3 deletions RouteHandler/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,19 +357,19 @@ router.put("/v1/user/self", async (req, res) => {
router.get("*", async (req, res) => {
console.log("Bad Route");
res.header("Cache-Control", "no-cache");
res.status(404).end();
res.status(405).end();
});

router.post("*", async (req, res) => {
console.log("Bad Route");
res.header("Cache-Control", "no-cache");
res.status(404).end();
res.status(405).end();
});

router.put("*", async (req, res) => {
console.log("Bad Route");

res.status(404).end();
res.status(405).end();
});

module.exports = router;
Loading