Skip to content
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

Finished hw #6

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

LehmanBrother
Copy link

No description provided.


app.listen(3000, () => {
console.log('server is listening on port 3000');
})
Copy link
Contributor

Choose a reason for hiding this comment

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

i'd recommend organizing this file a little more carefully. have a separate section for controllers and put all your controller stuff there (even though they are implemented the same way middleware is). example:

const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const methodOverride = require('method-override');

//middleware
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use(methodOverride('_method'));
app.use(express.static('public'));

// controllers
app.use('/pokemon', pokemonController);
const pokemonController = require('./controllers/pokemon');

app.get('/',(req, res) => {
	res.send('This is the server responding to a get request')
})

app.listen(3000, () => {
	console.log('server is listening on port 3000');
})

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