Added basic Hello World with logger.

This commit is contained in:
Carter Bertolini 2023-09-29 16:37:56 -04:00
parent c395bf812a
commit e65e2f7f73
3 changed files with 16 additions and 1 deletions

View File

@ -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
View 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!");

View File