Skip to content

db created, more left to fix.#7

Open
ezotic wants to merge 25 commits intocode-differently:mainfrom
ezotic:main
Open

db created, more left to fix.#7
ezotic wants to merge 25 commits intocode-differently:mainfrom
ezotic:main

Conversation

@ezotic
Copy link
Copy Markdown

@ezotic ezotic commented Mar 1, 2021

No description provided.

Copy link
Copy Markdown
Contributor

@kburd kburd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid solution!

@@ -0,0 +1,40 @@
const mysql = require('mysql');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend creating your schema with a sql script. You can run the script whenever you want to recreate your database

app.use(cors())
const port = 4000

app.get('/all/:count', async (req, response) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add this logic to rest/index.js. You only want to create one express app

);

CREATE TABLE types(
id INT PRIMARY KEY NOT NULL,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend using auto increment here as well

const port = 4000

app.get('/', (req, res) => {
res.send('Hello World!')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice test route :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants