0

This is just basic HTML. The website is just a poem by Stevie Wonder. Anyways, in the CS50 IDE I type in, "open hello.html" and there is nothing that happens! I thought this opens the website so you can see? Any help?

<!DOCTYPE html>
<html>
<head>
    <title>My Web Page!</title>
</head>
<body>
    <h1>My Cherie Amour:</h1>
    My cherie amour, lovely as a summer day
    My cherie amour, distant as the milky way
    My cherie amour, pretty little one that I adore
    You're the only girl my heart beats for
    How I wish that you were mine
    In a cafe or sometimes on a crowded street
    I've been near you, but you never noticed me
    My cherie amour, won't you tell me how could you ignore
    That behind that little smile I wore
    How I wish that you were mine
    Maybe someday, you'll see my face amoung the crowd
    Maybe someday, I'll share your little distant cloud
    Oh, cherie amour, pretty little one that I adore
    You're the only girl my heart beats for
    How I wish that you were mine
    </body>
    </html>

1 Answer 1

1

"open index.html" is not the appropriate command to open the browser, if we are in the appropriate directory, this command will open a file like this name in the IDE editor, if the file does not exist in the directory it will create a new file with that name (although not automatically saved). The correct command would be "apache50 start [directory]", where directory is the directory where we have index.html

EDIT: Maybe I have not explained myself correctly, suppose we have index.html in a folder called hypothetically templates, then from the root directory, something like this should appear in the terminal:

~/workspace/ $ apache50 start templates

The server will load and then in the menu bar we click on CS50 IDE-> Web Serve. We can also open the server from the terminal itself by clicking on something similar to this:

Your site is now available at https://ide50-username.cs50.io:8080
2
  • This still does not seem to open the webpage. I type in apache50 start [workspace] and [hello] and [hello.html] in many different ways but there is just this return statement at the command-line. Usage: apache50 [start VHOST_DIR|restart|reload|stop|status]
    – David
    Commented May 4, 2018 at 18:06
  • you can read my edit
    – MARS
    Commented May 4, 2018 at 20:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .