Skip to content

Commit

Permalink
account microservice works locally
Browse files Browse the repository at this point in the history
  • Loading branch information
pogi7 committed Oct 23, 2023
1 parent c972623 commit feaf33c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/account/account.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
import express from "express";
import { User } from "../models/UserSchema";

// Account microservice port
export const PORT = 5000;

// Creates an Express application
export const app = express();

// Single Routing
export const router = express.Router()

// Defines the structure of the error Object
interface ErrorWithMessage {
message: string
}

// Register method
router.post('/register', (req: any, res: any) => {
const user = new User({
Expand Down Expand Up @@ -37,6 +49,13 @@ router.post('/account', async (req: any, res: any) => {
});
})

// Use routes provided by the router
app.use(router)

app.listen(PORT, () => {
console.log("Account microservice listening on port: " + PORT)
})

// Update one

// Delete one
Expand Down

0 comments on commit feaf33c

Please sign in to comment.