1

I am relatively new to Node js.

I have built Node js / Angular Application based on angular-requirejs-seed

However, I found scripts/web-server.js confusing as I used to develop node js server with express.

Particularly, I want to implement file upload, but at least, I want to know how I can implement POST request handler within scripts/web-server.js

function main(argv) {
  new HttpServer({
    'GET': createServlet(StaticServlet),
    'HEAD': createServlet(StaticServlet)
  }).start(Number(argv[2]) || DEFAULT_PORT);
}

Please guide me in correct direction.

AlfredTK
  • 33
  • 2

1 Answers1

1

The node server in angular-requirejs-seed is not there to act as a fully-fledged webserver - only to sever the files in the seed project. You'll need to write your own backend (especially if you want to use express).

express 4 no longer supports file uploads, so you'll need to use a different package. I recommend busboy. (more details)

Community
  • 1
  • 1
SomeKittens
  • 38,868
  • 19
  • 114
  • 143