Node JS Content Type

I am trying to set the content-type to application/json in my Node js app.  I see examples of setting the content-type in the http.createServer routine, I'm using express so that syntax makes no sense to me!  But I believe I can set the content type in my mysql query routine which would make more sense  since I have multiple queries happening, both mysql and oracle.

If I do need to set up the content type in the server build, here's how I'm setting up the server:

var express = require('express');
var app = express();
var server = require('http').Server(app);
var io = require('socket.io')(server)

Thanks for any assistance. Node is driving me crazy...
kevbob650Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RobOwner (Aidellio)Commented:
Hopefully this helps but I went straight to using Sails sailsjs.org as it takes care of all that stuff for you.  It's built on the MVC principles so integrating with any database is independent from the database itself.  Have a read and let me know if it suits your application.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
kevbob650Author Commented:
I appreciate you looking into this. Sails looks very interesting, I will definitely explore. Thanks!
0
RobOwner (Aidellio)Commented:
No problem.  Glad it took your interest.  Certainly made life easy for me.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.