# Need help with express.static

**URL:** <https://forum.freecodecamp.org/t/need-help-with-express-static/146330>\
**Category:** General\
**Created:** [September 6, 2017, 3:16pm UTC](https://forum.freecodecamp.org/t/need-help-with-express-static/146330 "2017-09-06T15:16:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mhl7](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@Mhl7](https://forum.freecodecamp.org/u/Mhl7)\
**Post date:** [September 6, 2017, 3:16pm UTC](https://forum.freecodecamp.org/t/need-help-with-express-static/146330/1 "2017-09-06T15:16:32Z")

</div>

Hi forum,

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

```auto
var express = require("express");
var path = require("path");

var app = express();

app.use(express.static(path.join(__dirname, 'public')));

app.listen(process.argv[2]);

```

then I run the server with

```auto
$ node static.js 3000

```

and I send the request to the server using

```auto
$ 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

---

<div class="post-metadata">

**Author:** ![Mhl7](https://avatars.discourse-cdn.com/v4/letter/m/f4b2a3/32.png) [@Mhl7](https://forum.freecodecamp.org/u/Mhl7)\
**Post date:** [September 6, 2017, 3:30pm UTC](https://forum.freecodecamp.org/t/need-help-with-express-static/146330/2 "2017-09-06T15:30:47Z")

</div>

Solved: I did not save the file. Or else, the file was there, but was empty. Now I feel dumb: I spent 2h on this!

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:40pm UTC](https://forum.freecodecamp.org/t/need-help-with-express-static/146330/3 "2021-01-17T20:40:26Z")

</div>

Closed on January 17, 2021, 8:40pm UTC


