Getting Error "Cannot Get /" with Express/Node.JS

here is my index.js file

const express = require('express');
const cors = require('cors');
const ytdl = require('ytdl-core');

const app = express();


app.listen(4000, () => {
	console.log('Server Works !!! At port 4000');
app.get('/downloadmp3', (req,res) => {
	var url = req.query.url;
	res.header('Content-Disposition', 'attachment; filename="audio.mp3"');
	ytdl(url, {
		format: 'mp3',
		filter: 'audioonly'

app.get('/downloadmp4', (req,res) => {
	var url = req.query.url;
	res.header('Content-Disposition', 'attachment; filename="video.mp4"');
	ytdl(url, {
		format: 'mp4'

I need someone to help me plz.If you find this you are an kind, observant person. Unless you are an A**hole. Then you’re just observant.

Do you have an index.html in the same directory as the index.js file?

Do the other routes work?

your browser is listening for a response at ‘/’ but there was no get request made at that route. does it work when you try ‘/downloadmp3’ or ‘/downloadmp4’ ?

Here is a quick Glitch project (Anonymous projects expire after 5 days)



route ‘/express’ > JSON { message: “Hello from express”}


<!DOCTYPE html>
* {
    text-align: center;
.heading {
    font-family: Arial;
.URL-input, .convert-button {
    padding:5px 10px;
.URL-input {
    border-radius:4px 0px 0px 4px;
    text-align: left;
    border:2px solid #EEEEEE;
    background: #EEEEEE;
.URL-input:focus {
    border:2px solid #0485ff;
.convert-button {
    border-radius:0px 4px 4px 0px;
    border:2px solid #0485ff;
    background: #0485ff;
    <title>Games4U Video Downloader</title>
	<script src='./script.js'></script>
    <h1 class="heading">Games4U Video Downloader</h1>
    <input class="URL-input" placeholder="Video URL e.g.">
    <button class="convert-button">Convert</button>

So the files are inside the same root folder and the server is started from inside that folder?

Again, what about the other routes, do they work?

What happens if you make a folder named public (or whatever) and create an index.html inside it and point to that for the static serving?


It would help if you can upload your code to GitHub so we can see the full code and folder/file structure and package.json.

I’m new to coding and I took this here because there was problems with it. How would I do this?

Are you asking how to upload the code to GitHub?

No. Sorry if I caused confusion, but I meant how do I use different routes. I’ll get on uploading it to Github.

The code will be accesible at

Did you fix it? Your code on GitHub works just fine for me.

Not really sure what you are asking here? You already added routes so you must know how to do it. What routes other then what you have do you need?