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('')(server)

Thanks for any assistance. Node is driving me crazy...
Who is Participating?
RobOwner (Aidellio)Commented:
Hopefully this helps but I went straight to using Sails 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.
kevbob650Author Commented:
I appreciate you looking into this. Sails looks very interesting, I will definitely explore. Thanks!
RobOwner (Aidellio)Commented:
No problem.  Glad it took your interest.  Certainly made life easy for me.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.