Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
hkserver/index.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
17 lines (14 sloc)
428 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//import express module | |
var express = require('express'); | |
//create an express app | |
var app = express(); | |
//add a callback function to handle | |
//get request on the root | |
app.get('/', function(req, res) { | |
//save the html code in a variable | |
var homePage = "<h1 style='color:red'>Welcome to cubic Games</h1>"; | |
//send the html code to the client | |
res.send(homePage); | |
}); | |
//run the server on port 3000 | |
app.listen(3000); |