@@ -239,7 +239,7 @@ const transporter = nodemailer.createTransport({
239239} )
240240
241241//Login
242- app . post ( '/api/ login' , async ( req , res ) => {
242+ app . post ( '/login' , async ( req , res ) => {
243243 const { username, password } = req . body
244244
245245 try {
@@ -269,7 +269,7 @@ app.post('/api/login', async (req, res) => {
269269} )
270270
271271// Verify
272- app . post ( '/api/ verify-2fa' , async ( req , res ) => {
272+ app . post ( '/verify-2fa' , async ( req , res ) => {
273273 const { username, code } = req . body
274274 const entry = twoFACodes [ username ]
275275
@@ -296,7 +296,7 @@ app.post('/api/verify-2fa', async (req, res) => {
296296} )
297297
298298//Signup
299- app . post ( "/api/ signup" , async ( req , res ) => {
299+ app . post ( "/signup" , async ( req , res ) => {
300300 try {
301301 console . log ( "Incoming signup request:" , req . body ) ;
302302 const { fullname, username, email, password, address } = req . body ;
@@ -396,7 +396,7 @@ app.post('/api/driverlogin', async (req, res) => {
396396} ) ;
397397
398398//Driver get shipments
399- app . get ( '/api/ driver/shipments' , async ( req , res ) => {
399+ app . get ( '/driver/shipments' , async ( req , res ) => {
400400 try {
401401 const activeShipments = await TrackData . find ( { } , {
402402 trackingNumber : 1 ,
@@ -415,7 +415,7 @@ app.get('/api/driver/shipments', async (req, res) => {
415415 }
416416} )
417417// Driver selects shipments to track
418- app . post ( '/api/ driver/select-shipment' , async ( req , res ) => {
418+ app . post ( '/driver/select-shipment' , async ( req , res ) => {
419419 const { trackingNumber, driverUsername } = req . body ;
420420 console . log ( 'Received for assign:' , { trackingNumber, driverUsername } )
421421
@@ -438,7 +438,7 @@ app.post('/api/driver/select-shipment', async (req, res) => {
438438
439439
440440// Email
441- app . post ( "/api/ verify-email" , async ( req , res ) => {
441+ app . post ( "/verify-email" , async ( req , res ) => {
442442 try {
443443 const { email } = req . body ;
444444 // Get user from Firebase
@@ -511,7 +511,7 @@ app.post('/resend-verification', resendEmailLimiter, async (req, res) => {
511511} ) ;
512512
513513// Delete
514- app . delete ( '/api/ track/:trackingNumber' , async ( req , res ) => {
514+ app . delete ( '/track/:trackingNumber' , async ( req , res ) => {
515515 const { trackingNumber } = req . params ;
516516 try {
517517 const deletedShipment = await TrackData . findOneAndDelete ( { trackingNumber } ) ;
@@ -527,7 +527,7 @@ app.delete('/api/track/:trackingNumber', async (req, res) => {
527527} ) ;
528528
529529// Track Shipment
530- app . post ( '/api/ track' , async ( req , res ) => {
530+ app . post ( '/track' , async ( req , res ) => {
531531 const { trackingNumber } = req . body ;
532532
533533 try {
@@ -634,7 +634,7 @@ function getStatusMessage(status, location) {
634634}
635635
636636
637- app . get ( '/api/ history' , async ( req , res ) => {
637+ app . get ( '/history' , async ( req , res ) => {
638638 try {
639639 const shippedData = await TrackData . find ( ) ;
640640 if ( shippedData . length > 0 ) {
0 commit comments