Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

How to create a database with node and express?

The express and sequelize courses never seem to cover how to actually create a database, they always assume you have one running. If I want to deploy an application built on node and express and use sequelize, I need to have a database to connect to. How would I create a file that would create the database for the production server? How would any of this work? Thanks.

1 Answer

Artur Markov
Artur Markov
3,447 Points

Depends on which database you'd like to use. For example, MySQL, you should create NAME.sql document. Then in your server.js file you should add "mysql" NPM package. You can go to this web-site to read, how to use it https://www.npmjs.com/package/mysql . Actually using MongoDB is the same

Sorry, but your answer isn't helpful considering no course I've ever taken on treehouse has said anything about a server.js file or anything like that. Thanks though.