Having problems with Node Meet the Node Console challenge

=>please help me the steps for this task,
=> i created glitch in[ https://thorn-paint.glitch.me/]
=> i printed the hello world in console, if i paste the link it’s not working,

You need to hit ‘Share’ button on top left of your browser.

Copy the link under ‘Share your app’ and paste it.

Here are the my screen shots…please help me

Thanks for response,

I provided that link but not working…

This is what I meant.

yea, i used that link to submit task but it’s showing,

error:
// running test
Not found
// tests completed

How you print?
in node. jS
or script?

Using node.
i added server.js file in that

/******************************************************

  • PLEASE DO NOT EDIT THIS FILE
  • the verification process may break
  • ***************************************************/

‘use strict’;

var fs = require(‘fs’);
var express = require(‘express’);
var app = express();

if (!process.env.DISABLE_XORIGIN) {
app.use(function(req, res, next) {
var allowedOrigins = [‘https://narrow-plane.gomix.me’, ‘https://www.freecodecamp.com’];
var origin = req.headers.origin || ‘*’;
if(!process.env.XORIG_RESTRICT || allowedOrigins.indexOf(origin) > -1){
console.log(origin);

     res.setHeader('Access-Control-Allow-Origin', origin);
     res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
}
next();

});
}

app.use(’/public’, express.static(process.cwd() + ‘/public’));

app.route(’/_api/package.json’)
.get(function(req, res, next) {
console.log(‘requested’);
fs.readFile(__dirname + ‘/package.json’, function(err, data) {
if(err) return next(err);
res.type(‘txt’).send(data.toString());
});
});

app.route(’/’)
.get(function(req, res) {
res.sendFile(process.cwd() + ‘/views/index.html’);
})

// Respond not found to all the wrong routes
app.use(function(req, res, next){
res.status(404);
res.type(‘txt’).send(‘Not found’);
});

// Error Middleware
app.use(function(err, req, res, next) {
if(err) {
res.status(err.status || 500)
.type(‘txt’)
.send(err.message || ‘SERVER ERROR’);
}
})

app.listen(process.env.PORT, function () {
console.log(‘Node.js listening …’);
console.log(‘Hello World’);

});

There should not be add the server.js file. I see a problem, the glitch project is previous Manage Node.js…
I made also in this mistake I didn’t notice the new glitch project. There is myapp.js


3 Likes

hey thanks for your response,

can you kindly guide me the steps which i need to follow to complete this task =>
https://learn.freecodecamp.org/apis-and-microservices/basic-node-and-express/meet-the-node-console/

next task onwards i will complete myself.

I already did, you are in bad project

I needed to create a new project from scratch and upload all files from boilerplate-express repository. The project that I was using to solve the problems in the Managing Packages with Npm section did not work for the Meet the Node console lesson, no chance.

This entire section was revamped to use repl.it. The ’ Meet the Node console’ project is returning 404 response code from the project…