-
Notifications
You must be signed in to change notification settings - Fork 0
Add console #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add console #2
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,6 @@ | ||||||
| import repl from 'repl' | ||||||
| import app from '../src/app.js' | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Replace
Suggested change
|
||||||
|
|
||||||
| Object.assign(repl.start().context, { | ||||||
| app, | ||||||
| }) | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,18 @@ | ||||||
| import cors from 'express' | ||||||
| import express from 'express' | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Replace
Suggested change
|
||||||
| import sqlite from 'sqlite3' | ||||||
| import ejs from 'ejs' | ||||||
|
|
||||||
| const db = new sqlite.Database('../db.sqlite') | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Replace
Suggested change
|
||||||
|
|
||||||
| const app = express() | ||||||
|
|
||||||
| app.db = db | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Insert
Suggested change
|
||||||
|
|
||||||
| app.set('view engine', 'ejs') | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Replace
Suggested change
|
||||||
|
|
||||||
| app.get('/', function(request, response) { | ||||||
| response.render('index') | ||||||
| }) | ||||||
|
|
||||||
| export default app | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Insert
Suggested change
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,21 +1,9 @@ | ||||||
| import cors from 'express' | ||||||
| import express from 'express' | ||||||
| import sqlite from 'sqlite3' | ||||||
| import ejs from 'ejs' | ||||||
| import app from './app.js' | ||||||
|
|
||||||
| const db = new sqlite.Database('../db.sqlite') | ||||||
|
|
||||||
| const app = express() | ||||||
| const port = 4004 | ||||||
|
|
||||||
| app.set('view engine', 'ejs') | ||||||
|
|
||||||
| app.get('/', function(request, response) { | ||||||
| response.render('index') | ||||||
| }) | ||||||
|
|
||||||
| app.listen(port, function() { | ||||||
| console.log(`Listening on port ${port}`) | ||||||
| }) | ||||||
|
|
||||||
| db.close() | ||||||
| app.db.close() | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codacy has a fix for the issue: Insert
Suggested change
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codacy has a fix for the issue: Replace
'repl'with"repl";