Skip to content

Commit

Permalink
Entry Point Migration (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyumat committed Jan 8, 2023
1 parent 94b7aec commit f8ff566
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 126 deletions.
111 changes: 0 additions & 111 deletions backend/index.js

This file was deleted.

30 changes: 15 additions & 15 deletions backend/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import express from "express";
import express, { Request, Response } from "express";
import dotenv from "dotenv";
import os from "os";
import bodyParser from "body-parser";
Expand Down Expand Up @@ -29,7 +29,7 @@ import create_machine from "./routes/crud/create/create_machine.js";
import update_status from "./routes/crud/update/update_status.js";
import end_workout from "./routes/crud/delete/end_workout.js";
import rate_workout from "./routes/crud/update/rate_workout.js";
import add_exercise from "./routes/crud/create/create_exercise.js";
import create_exercise from "./routes/crud/create/create_exercise.js";
import update_set from "./routes/crud/update/update_set.js";

dotenv.config();
Expand Down Expand Up @@ -68,34 +68,34 @@ app.use("/api/users/register", register);
app.use("/api/users/login", login);
// Logout a user endpoint.
app.use("/api/users/logout", logout);
// Get user endpoint.
app.use("/api/users/get", get_user);
// Create a new workout for a user.
app.use("/api/workouts/create", create_workout);
// Add a new machine to a workout.
app.use("/api/workout/machines/add", add_machine);
// Update cardio machine 'x' with a distance and time spent.
app.use("/api/workout/machines/cardio/add", update_cardio);
// Add a machine to the dixon collectiion
app.use("/api/machine/create", create_machine);
// Get all the machines in the dixon collection
app.use("/api/machines/get", get_machines);
// Add an exercise to a workout.
app.use("/api/workout/exercises/add", create_exercise);
// Add a new machine to a workout.
app.use("/api/workout/machines/add", add_machine);
// Update a machine's status in a workout.
app.use("/api/machine/update_status", update_status);
// Update cardio machine 'x' with a distance and time spent.
app.use("/api/workout/machines/cardio/add", update_cardio);
// Update the user's profile
app.use("/api/users/update", update_user);
// Add a sets to a strength machine.
app.use("/api/workout/machines/sets/add", update_set);
// Get user endpoint.
app.use("/api/users/get", get_user);
// Get all the machines in the dixon collection
app.use("/api/machines/get", get_machines);
// Get the user's workout and saved workouts.
app.use("/api/workouts/get", get_workouts);
// End the user's workout.
app.use("/api/workout/end", end_workout);
// Rate the user's workout.
app.use("/api/workout/rate", rate_workout);
// Add an exercise to a workout.
app.use("/api/workout/exercises/add", add_exercise);
// Add a sets to a strength machine.
app.use("/api/workout/machines/sets/add", update_set);

app.get("/api", (req, res) => {
app.get("/api", (req: Request, res: Response) => {
res.send({ username: os.userInfo().username });
});

Expand Down

0 comments on commit f8ff566

Please sign in to comment.