Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8624837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:37:50+00:00 2026-06-12T07:37:50+00:00

I am working on an assignment for a college course involving json and node.js.

  • 0

I am working on an assignment for a college course involving json and node.js. I have ran into an error, and I can’t seem to figure out what I am doing wrong.

Here is the error:

/home/ubuntu/node_stuff/node_json2/requestHandlers.js:22
'<li>'appts.appointments.appt1.busName'</li>'+
      ^^^^^
SyntaxError: Unexpected identifier
at Module._compile (module.js:437:25)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.<anonymous> (/home/ubuntu/node_stuff/node_json2/index.js:3:23)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)

Here are the files I am working with:

appts.js

module.exports = {appointments: {
debug: "on",
appt1: {
    busName: "Asheville Eye Associates",
address: {
    street: "8 Medical Park Drive",
    city: "Asheville",
    state: "NC",
    zip: "28803"
},
phone: "828-258-1586",
apptDate: "October 5 2012",
dotw: "Friday",
apptTime: "9:00 am"
},
appt2: {
    busName: "Asheville Dental Care",
    address: {
            street: "10 Yorkshire Street",
            city: "Asheville",
            state: "NC",
            zip: "28803"
    },
    phone: "828-274-3882",
    apptDate: "October 22 2012",
dotw: "Monday",
    apptTime: "10:30 am"
},
appt3: {
    busName: "Asheville Cardiology",
    address: {
            street: "5 Vanderbilt Park Drive",
            city: "Asheville",
            state: "NC",
            zip: "28803"
    },
    phone: "828-274-6000",
    apptDate: "November 14 2012",
dotw: "Wednesday",
    apptTime: "9:30 am"
},

}};

requestHandlers.js

var querystring = require("querystring"),
appts = require("./appts"),
fs = require("fs");

function home(response, postData) {
console.log("Appointments have been parsed from JSON");
console.log("Request handler 'start' was called.");
console.log("stringify appts");
appts = JSON.stringify(appts);
console.log("parse appts");
appts = JSON.parse(appts);
console.log(appts.appointments);

var body = '<html>'+
'<head>'+
'<meta http-equiv="Content-Type" '+
'content="text/html; charset=UTF-8" />'+
'</head>'+
'<body>'+
'<h1>Appointment 1</h1>'+
'<ul>'+
    '<li>'appts.appointments.appt1.busName'</li>'+
    '<li>'appts.appointments.appt1.address.street'</li>'+
    '<li>'appts.appointments.appt1.address.city + " " + appts.appointments.appt1.address.state + " " + appts.appointments.appt1.address.zip'</li>'+
    '<li>'appts.appointments.appt1.phone'</li>'+
    '<li>'appts.appointments.appt1.apptDate'</li>'+
    '<li>'appts.appointments.appt1.dotw</li>'+
    '<li>'appts.appointments.appt1.apptTime'</li>'+    
'</ul>'+
'<h1>Appointment 2</h1>'+
'<ul>'+
    '<li>'appts.appointments.appt2.busName'</li>'+
    '<li>'appts.appointments.appt2.address.street'</li>'+
    '<li>'appts.appointments.appt2.address.city + " " + appts.appointments.appt2.address.state + " " + appts.appointments.appt2.address.zip'</li>'+
    '<li>'appts.appointments.appt2.phone'</li>'+
    '<li>'appts.appointments.appt2.apptDate'</li>'+
    '<li>'appts.appointments.appt2.dotw'</li>'+
    '<li>'appts.appointments.appt2.apptTime'</li>'+
'</ul>'+
'<h1>Appointment 3</h1>'+
'<ul>'+
    '<li>'appts.appointments.appt3.busName'</li>'+
    '<li>'appts.appointments.appt3.address.street'</li>'+
    '<li>'appts.appointments.appt3.address.city + " " + appts.appointments.appt3.address.state + " " + appts.appointments.appt3.address.zip'</li>'+
    '<li>'appts.appointments.appt3.phone'</li>'+
    '<li>'appts.appointments.appt3.apptDate'</li>'+
    '<li>'appts.appointments.appt3.dotw'</li>'+
    '<li>'appts.appointments.appt3.apptTime'</li>'+
'</ul>'+
'</body>'+
'</html>';

response.writeHead(200, {"Content-Type": "text/html"});
response.write(body);
response.end();
}

exports.home = home;

I am sure my problem is something simple, but this is my first time pulling in objects from another file. I appreciate any help you guys can offer, thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:37:52+00:00Added an answer on June 12, 2026 at 7:37 am

    You have forgot operator (probably + after '<li>'). But, you could be interested in using some templating engine instead of writing code yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on an assignment, and can't figure it out. We have to
I just started working with node.js and json objects in my college course. One
I have the following code that I am working on for my college assignment.
I have been working on a college C assignment, and have been trying to
I'm working on my assignment of PHP course. The problem that I don't understand
I am working on an assignment where I have to implement a recursive way
I'm working of my assignment, in C, which to store 500 string into strings
I'm currently working on an assignment and this have had me stuck for hours.
I am working on an assignment with polymorphism and have followed online tutorials that
I'm working on an assignment to implement insertions into an AVL tree, and I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.