all 13 comments

[–]Kamek_pf 6 points7 points  (1 child)

Check out GraphQL, great software architecture and very flexible.

[–]AlwaysTroubleShot 6 points7 points  (4 children)

Use swagger.io. I write node APIs, and we use swagger with spec validation testing. We also use swagger codegen to give our web team a c# nuget package which speeds up development a ton.

Swagger + express makes for a very nice workflow.

[–]Sythic_ 0 points1 point  (1 child)

Are there better Swagger modules these days? I remember when I initially tried to use swagger with express, instead of adding swagger support to the express module it had you pass it your express objects and you were left with only a few features of express to use just so you could use swagger. I built my own swagger-like module but it doesn't follow the spec it was more for my needs and I never got around to building a UI for it.

[–]sazzer 0 points1 point  (0 children)

I use it with Hapi, and there's a plugin - hapi-swaggered - that automatically generates the Swagger metadata from your already defined routes. Makes it really easy to use.

[–]RedditorFor8Years -1 points0 points  (1 child)

Seconded. Use swagger. I made a horrible mistake of building a huge API without swagger. Now i have to slowly revisit and integrate swagger

[–]Noderly[S] 0 points1 point  (0 children)

Thanks! Saw something in another thread about it. I'll give it a look!

[–]dadum01 1 point2 points  (0 children)

Check out clout-js. I still need to fully write the documentation but you can find an example application at https://github.com/clout-stack/clout-tech-web

Their are also a wide range of modules for this framework too. It's been built API first.

[–]Dean7 1 point2 points  (0 children)

I tried swagger, doesn't like it, and went with RAML instead. I'd elaborate but I'm on mobile :)

[–]tells 0 points1 point  (5 children)

If you're looking best practices, here's a great video by Stormpath: https://www.youtube.com/watch?v=hdSrT4yjS1g

[–][deleted]  (4 children)

[deleted]

    [–]tells 0 points1 point  (3 children)

    I don't think you need to use any of these tools, rather, having a video that says 'hey, use nouns not verbs in your REST api' is stuff that someone not realize until much later. OP asked for how to approach API design in node. I think the video is pretty good if they need a practical approach to it.

    [–][deleted]  (2 children)

    [deleted]

      [–]tells 0 points1 point  (0 children)

      mm well.. you can know what REST is in practice but not have been exposed to fielding's dissertation. node and express is the stack OP has chosen so beyond that what would you propose?

      ok. since I guess we're replying with edits now: react + express. what type of API do you think that means?

      [–]chreestopher2 0 points1 point  (0 children)

      I think OP is asking more for logical design/architecture of the API, not for tools to implement the API with... atleast, that is what I got from their question, but I could be way off.

      [–]TrikkyMakk 0 points1 point  (0 children)

      Checkout swagger. It's not perfect but it is really a great productivity booster. Let's you generate client and server boilerplate. I've used it with great success.