removed unused code
This commit is contained in:
parent
e562e3f590
commit
931d41d04c
4 changed files with 6 additions and 51 deletions
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"courier_available_timeslots": [
|
||||
{
|
||||
"id": 1,
|
||||
"start_time": "2023-09-17 08:00:00",
|
||||
"end_time": "2023-09-17 09:00:00",
|
||||
"supported_postcodes": [
|
||||
|
@ -9,6 +10,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"start_time": "2023-09-17 09:00:00",
|
||||
"end_time": "2023-09-17 10:00:00",
|
||||
"supported_postcodes": [
|
||||
|
@ -18,6 +20,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"start_time": "2023-09-17 09:00:00",
|
||||
"end_time": "2023-09-17 10:00:00",
|
||||
"supported_postcodes": [
|
||||
|
@ -27,6 +30,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"start_time": "2023-09-18 14:00:00",
|
||||
"end_time": "2023-09-18 15:00:00",
|
||||
"supported_postcodes": [
|
||||
|
|
50
src/index.ts
50
src/index.ts
|
@ -1,59 +1,9 @@
|
|||
import app from './app';
|
||||
import fs from 'fs';
|
||||
|
||||
const env = process.env.NODE_ENV || 'development';
|
||||
const PORT = process.env.PORT || 3000;
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log("STARTING ... ")
|
||||
if (env === 'development') {
|
||||
console.log("Generating mock data files")
|
||||
// generateMockDataFiles();
|
||||
}
|
||||
console.log(`Server is running on port ${PORT}`);
|
||||
});
|
||||
|
||||
|
||||
// const generateMockDataFiles = () => {
|
||||
|
||||
// if (!fs.existsSync('./data')) {
|
||||
// fs.mkdirSync('./data');
|
||||
// }
|
||||
|
||||
// if (!fs.existsSync('./data/timeSlots.json')) {
|
||||
// const timeSlots = {
|
||||
// timeSlots: [
|
||||
// "08:00 - 10:00",
|
||||
// "10:00 - 12:00",
|
||||
// "12:00 - 14:00",
|
||||
// "14:00 - 16:00",
|
||||
// "16:00 - 18:00",
|
||||
// "18:00 - 20:00"
|
||||
// ]
|
||||
// }
|
||||
// fs.writeFileSync('./data/timeSlots.json', JSON.stringify(timeSlots));
|
||||
// }
|
||||
|
||||
// if (!fs.existsSync('./data/holidays.json')) {
|
||||
// const holidays = {
|
||||
// "holidays": [
|
||||
// {
|
||||
// "name": "New Year's Day",
|
||||
// "date": "2023-01-17",
|
||||
// "country": "US"
|
||||
// },
|
||||
// {
|
||||
// "name": "Mother's Day",
|
||||
// "date": "2023-09-18",
|
||||
// "country": "US"
|
||||
// },
|
||||
// {
|
||||
// "name": "Independence Day",
|
||||
// "date": "2023-10-17",
|
||||
// "country": "US"
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// fs.writeFileSync('./data/holidays.json', JSON.stringify(holidays));
|
||||
// }
|
||||
// }
|
|
@ -3,4 +3,4 @@ import timeSlots from '../data/timeslots.json';
|
|||
|
||||
export function getAvailableTimeSlots() {
|
||||
return Promise.resolve(timeSlots);
|
||||
}
|
||||
}
|
|
@ -8,6 +8,7 @@ export interface Address {
|
|||
}
|
||||
|
||||
export interface AvailableTimeslots {
|
||||
id: number;
|
||||
start_time: string;
|
||||
end_time: string;
|
||||
}
|
Loading…
Reference in a new issue