Added basic Hello World with logger.
This commit is contained in:
parent
c395bf812a
commit
e65e2f7f73
@ -2,8 +2,9 @@
|
|||||||
"name": "finvis-backend",
|
"name": "finvis-backend",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "A financial tracking web app that allows users to track their investments across multiple exchanges.",
|
"description": "A financial tracking web app that allows users to track their investments across multiple exchanges.",
|
||||||
"main": "index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"start": "node dist/index.js",
|
||||||
"lint": "eslint . --fix"
|
"lint": "eslint . --fix"
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
|
14
src/index.ts
Normal file
14
src/index.ts
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import { createLogger, transports, format } from "winston";
|
||||||
|
|
||||||
|
const logger = createLogger({
|
||||||
|
transports: [new transports.Console()],
|
||||||
|
format: format.combine(
|
||||||
|
format.colorize(),
|
||||||
|
format.timestamp(),
|
||||||
|
format.printf(({ timestamp, level, message }) => {
|
||||||
|
return `[${timestamp}] ${level}: ${message}`;
|
||||||
|
})
|
||||||
|
),
|
||||||
|
});
|
||||||
|
|
||||||
|
logger.info("Hello world!");
|
Reference in New Issue
Block a user