C9 API not working

C9 API not working
0.0 0

#1

Hello all,

I’m currently working on the time stamp project and I run into a bit of an error when trying to make a GET request to my project.

When I start the node server in the terminal, the first “It’s working” comes up but the second console.log when using “/dateValules” I get the login error.

The URL I’m using is: https://timestampmicroservice1fcc.c9users.io/dateValues

and I’m going to post my js file down below. The problem is that it asks me to log in into cloud 9, but my project is public on cloud 9. Could this be because my repo is in a folder inside my project?

Here is my js:

var express = require('express');
var bodyParser = require('body-parser');
var cors = require('cors');


var app = module.exports = express();

app.use(bodyParser.json());

app.use(cors());

app.get('/dateValues', function(req, res, next) {
    console.log('URL')
})

app.listen(8080, function (req, res) {
        console.log("It's Working")
});