top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

Can't load the html page from node.js

+1 vote

History / Context: Display the html page from node.js

Problem Statement: The database is connected, but when i am running it in local host it is showing 'Cannot GET'.

Expected Result: It should load the html page from node.js

Present Output: Database is connected but cant load the page of html

Attach Code:


var express = require('express'),
    filter = express(),
    server = require('http').createServer(filter),
    io = require('').listen(server),
    mongoose = require('mongoose');

server.listen(7550, '');
console.log('Server running at');

mongoose.connect('mongodb://localhost/filter_CheckBoxSchema', function (err) {
    if (err) {
        console.log('What happened!!!');
    } else {
        console.log('Connected to mongodb!');

var filter_CheckBoxSchema = mongoose.Schema({
    category: { name: String, type: Boolean, default: false },
    created: { type: Date, default: }

var Filter = mongoose.model('Filter', filter_CheckBoxSchema);
filter.get('example.html', function (req, res) {    
    new Filter({
        type: req.body.gender,

    }).save(function (err, doc) {
        if (err) {
            throw err;
            res.send('Successfully inserted!!!');


            Please enter your details
        <h3>Please enter your details</h3>
        <p>Please register below!!!</p>
        <form action="filter.js" method="POST">
            Name: <input type="text" name="Name" />
            <br /><p></p>
            <br />
            <input type="radio" name="gender" /> Male
            <br />
            <input type="radio" name="gender" /> Female
            Interest: (Check all that apply)
            <input type="checkbox" name="breakfast" /> Breakfast
            <br />
            <input type="checkbox" name="Lunch" /> Lunch
            <br />
            <input type="checkbox" name="Evening Snacks" /> Evening Snacks
            <br />
            <input type="checkbox" name="Dinner" /> Dinner
            <br />
            <input type="submit" name="submit" value="Register!!!" />
posted Aug 5, 2014 by anonymous

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button
It seems to be identical of

Just check if the same link solves your problem. Else comment and provide some logs.

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.