Skip to content

Commit

Permalink
feat: updated JS-PostgreSQL-TypeORM-NoAuth-Template
Browse files Browse the repository at this point in the history
Co-Authored-By: Mr Sharafdin <83120892+isasharafdin@users.noreply.github.com>
  • Loading branch information
abdinasir-Tman and sharafdin committed Feb 26, 2024
1 parent 0dff088 commit 9e450dd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
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 9e450dd

Please sign in to comment.