Skip to content

Commit

Permalink
feat: updating JS-NoAuth-Templates #192
Browse files Browse the repository at this point in the history
updated the js part of the templates
  • Loading branch information
sharafdin authored Feb 26, 2024
2 parents 75eca56 + 9e450dd commit e4a4064
Show file tree
Hide file tree
Showing 22 changed files with 44 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vscode
/node_modules
.env
.env
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"uuidv4": "^6.2.13"
},
"devDependencies": {
"yonode": "^0.7.0",
"yonode": "^0.6.0",
"nodemon": "^3.0.1"
}
}
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/node_modules
.vscode
/node_modules
.env

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"uuidv4": "^6.2.13"
},
"devDependencies": {
"yonode": "^0.7.0",
"yonode": "^0.6.0",
"nodemon": "^3.0.1",
"prisma": "^5.9.1"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
// import the packages
import express from "express";
import chalk from "chalk";

//import your files
// import your files
import { port } from "./config/initial.config.js";
import chalk from "chalk";

// Initializing the app
// initializing the app
const app = express();
app.use(express.json());

// rest of your code here


app.listen(port, () => {
console.log(`${chalk.green.bold("Server")} is listening on port ${port}`);
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import express from "express";

const routerName = express.Router();
export default routerName;

export default routerName;
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"typeorm": "0.3.20"
},
"devDependencies": {
"yonode": "^0.7.0",
"yonode": "^0.6.0",
"nodemon": "^3.0.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ app.use(express.json());

// rest of your code here


app.listen(port, () => {
console.log(`${chalk.green.bold("Server")} is listening on port ${port}`);
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@ const AppDataSource = new DataSource({

AppDataSource.initialize()
.then(async () => {
console.log(
`${chalk.green.bold("Successfully")} connected to the database`
);
console.log(`${chalk.green.bold('Connected')} to the database`);
})
.catch((error) =>
console.log(
`${chalk.red.bold("Failed")} to connect to the database: ${error}`
)
console.log(`${chalk.red.bold('Error')} connecting to database`, error);
);

export default AppDataSource;
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/node_modules
.vscode
/node_modules
.env
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
// import the packages
import express from "express";
import chalk from "chalk";

//import your files
// import your files
import { port } from "./config/initial.config.js";
import chalk from "chalk";

// Initializing the app
const app = express();
app.use(express.json());

// rest of your code here


app.listen(port, () => {
console.log(`${chalk.green.bold("Server")} is listening on port ${port}`);
});
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vscode
/node_modules
.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ app.use(express.json());
// rest of your code here


// database connection
connectDB()

app.listen(port, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.vscode/
.vscode
node_modules/

.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ const AppDataSource = new DataSource({

AppDataSource.initialize()
.then(async () => {
console.log(
`${chalk.green.bold("Successfully")} connected to the database`
);
console.log(`${chalk.green.bold('Connected')} to the database`);
})
.catch((error) =>
console.log(
`${chalk.red.bold("Failed")} to connect to the database: ${error}`
)
console.log(`${chalk.red.bold('Error')} connecting to database`, error);
);

export default AppDataSource;
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vscode
/node_modules
.env
.env
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
// import the packages
import express from "express";
import chalk from "chalk";

//import your files
// import your files
import { port } from "./config/initial.config.js";
import chalk from "chalk";

// Initializing the app
const app = express();
app.use(express.json());

// rest of your code here


app.listen(port, () => {
console.log(`${chalk.green.bold("Server")} is listening on port ${port}`);
});
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vscode
/node_modules
.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ app.use(express.json());
// rest of your code here


// database connection
connectDB()

app.listen(port, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.vscode/
.vscode
node_modules/
.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
import express from "express";
import chalk from "chalk";

//import your files
// import your files
import { port } from "./config/initial.config.js";
import "./config/db.config.js";

//initializing the app
// initializing the app
const app = express();
app.use(express.json());

// rest of your code here


app.listen(port, () => {
console.log(`${chalk.green.bold("Server")} is listening on port ${port}`);
});
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ const AppDataSource = new DataSource({

AppDataSource.initialize()
.then(async () => {
console.log(
`${chalk.green.bold("Successfully")} connected to the database`
);
console.log(`${chalk.green.bold('Connected')} to the database`);
})
.catch((error) =>
console.log(
`${chalk.red.bold("Failed")} to connect to the database: ${error}`
)
console.log(`${chalk.red.bold('Error')} connecting to database`, error);
);

export default AppDataSource;

0 comments on commit e4a4064

Please sign in to comment.