Skip to content

Commit

Permalink
fix tests; comment out unimplemented actions
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderGi committed Jan 6, 2024
1 parent 9983601 commit 0225a0c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 33 deletions.
8 changes: 4 additions & 4 deletions .badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions .badges/file-count.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h1>Actions</h1>
<action-icon name="Take Attendance" icon="icon-scanner-solid" link="scanner.html" description="Pick a business and event to start taking attendance or create a new event."></action-icon>
<action-icon name="Start a Group" icon="fa-solid fa-user-group" link="payment.html" description="Start a group to record attendance for your business."></action-icon>
</div>
<div class="rows">
<!-- <div class="rows">
<action-icon name="Launch Event" icon="fa-solid fa-rocket" link="scanner.html#launch" description="Creates a free group and launches a new event. Everyone who attends the event will automatically be added to the group."></action-icon>
<action-icon name="Collect RSVPs" icon="fa-solid fa-envelope" link="404.html" description="Send out requests for members to indicate whether they will attend your event."></action-icon>
<action-icon name="Track Work Hours" icon="fa-solid fa-clock" link="404.html" description="Log when employees arrive at the workplace and when they leave at the end of the day."></action-icon>
Expand All @@ -94,7 +94,7 @@ <h1>Actions</h1>
<action-icon name="When2Meet" icon="fa-solid fa-calendar" link="404.html" description="Group members indicate which days and times they can meet and you are presented with buttons to instantly create events on the available timeslots."></action-icon>
<action-icon name="Analytic Overview" icon="fas fa-chart-bar" link="404.html" description="As an owner, see which members put in the hours and view statistics on which events and dates members attend. As a member, see your attendance, report mistakes, and figure out where you need to step it up."></action-icon>
<action-icon name="Report Absence" icon="icon-tombstone-solid" link="404.html" description="Know you'll be absent at a future event? Report it here so your group admins and moderators can plan accordingly."></action-icon>
</div>
</div> -->
</section>
<section class="not-logged-in medium-section">
<h1>
Expand Down
53 changes: 30 additions & 23 deletions server/server.js
Original file line number Diff line number Diff line change
@@ -1,60 +1,67 @@
'use strict';
"use strict";

// express.js framework
const express = require("express");
const app = express();

// parsing post bodies
const bodyParser = require('body-parser');
const bodyParser = require("body-parser");
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());

// cors - make server endpoints available on firebase domain
const cors = require('cors')
const cors = require("cors");
let corsOptions = {
origin: 'https://attendancescannerqr.web.app',
}
app.use(cors(corsOptions))
origin: "https://attendancescannerqr.web.app",
};
app.use(cors(corsOptions));

// ============================ PUBLIC (STATIC) FILES ============================
// http://expressjs.com/en/starter/static-files.html
app.use(express.static("public"));

// ============================ DATABASE ============================
const schemaFile = "./server/databaseSchema.sql"; // filepath for the database schema
module.exports.initPromise = require('./Database').reinitializeIfNotExists(process.env.DB_FILE, schemaFile);
module.exports.initPromise = require("./Database").reinitializeIfNotExists(
process.env.DB_FILE,
schemaFile
);

// ============================ SUPER ADMIN ============================
// for modifying and viewing database contents without manually running SQL commands
// go to http://localhost:3000/super_admin/ to view
module.exports.initPromise.then(() => {
const { superAdminRouter } = require('./SuperAdmin');
app.use('/super_admin', superAdminRouter);
});
if (process.env.DB_FILE != ":memory:") {
module.exports.initPromise.then(() => {
const { superAdminRouter } = require("./SuperAdmin");
app.use("/super_admin", superAdminRouter);
});
}

// ============================ AUTHENTICATION ============================
const { authRouter } = require('./Auth');
app.use('/', authRouter);
const { authRouter } = require("./Auth");
app.use("/", authRouter);

// ============================ PAYMENT ============================
const { paymentRouter } = require('./Payment');
app.use('/', paymentRouter);
const { paymentRouter } = require("./Payment");
app.use("/", paymentRouter);

// ============================ BUSINESS ============================
const { businessRouter } = require('./Business');
app.use('/', businessRouter);
const { businessRouter } = require("./Business");
app.use("/", businessRouter);

// ============================ ATTENDANCE ============================
const { attendanceRouter } = require('./Attendance');
app.use('/', attendanceRouter);
const { attendanceRouter } = require("./Attendance");
app.use("/", attendanceRouter);

// ============================ EVENTS ============================
const { eventRouter } = require('./Event');
app.use('/', eventRouter);
const { eventRouter } = require("./Event");
app.use("/", eventRouter);

// ============================ SERVER ============================
// listen for requests :)
module.exports.app = app;
module.exports.listener = app.listen(process.env.PORT, () => {
console.log(`Your app is listening on port ${module.exports.listener.address().port}`);
});
console.log(
`Your app is listening on port ${module.exports.listener.address().port}`
);
});

0 comments on commit 0225a0c

Please sign in to comment.