Skip to content

Succesful fetch to api#12

Open
AntSmithCode wants to merge 3 commits intocode-differently:mainfrom
AntSmithCode:main
Open

Succesful fetch to api#12
AntSmithCode wants to merge 3 commits intocode-differently:mainfrom
AntSmithCode:main

Conversation

@AntSmithCode
Copy link
Copy Markdown

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.

Awesome work, next step is to display the data on the front end then import the data into the database

ALTER TABLE pokemon_type ADD FOREIGN KEY(pokemon_id) REFERENCES pokemon(pokemon_id);
ALTER TABLE pokemon_type ADD FOREIGN KEY(type_id) REFERENCES types(type_id);
INSERT INTO pokemon (pokemon_id, name)
VALUES
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.

You generally don't want to include insertions in your schema, just database and table creations

@@ -1,11 +1,24 @@
const express = require('express')
const app = express()
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 recommend moving this logic to rest/index.js and moving the logic there to a file named APIRouter.js

@@ -0,0 +1,25 @@
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 would recommend moving this logic to the rest folder. While this file represents the persistence layer (the code who's responsible for talking to and maintaining the database) it is a service on the backend

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