I am trying to use express.static to return the file index.html, but it won’t. I am running everything on cloud9.
I have the following, which is called static.js
var express = require("express"); var path = require("path"); var app = express(); app.use(express.static(path.join(__dirname, 'public'))); app.listen(process.argv);
then I run the server with
$ node static.js 3000
and I send the request to the server using
$ curl localhost:3000
But I don’t get any result. I also don’t get any error. Ideas?
the file that I want to get is /home/ubuntu/workspace/public/index.html