[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Hello /g/ What's the best way to build a restful api with

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 17
Thread images: 2

Hello /g/
What's the best way to build a restful api with express and mysql?
>>
install gentoo
>>
start coding already
>>
why mysql though?
>>
>>58142527
Just fucking make it bruh express is easy as fuck.
>>
>>58142527
Does anyone know if it is possible to link arbitrary compiled libraries to nodejs programs? I think it would be a great platform for scripting and gui (electron) stuff if I could link it with code written in faster (read: better) languages
>>
>>58142527
Use MongoDB with a wrapper like mongoose if you are gonna go Express.
It's easy as fuck too, just look up the docs.
>>
>>58143771
Probably not libs but there is a node module for creating child processes, I've only used it for executing php but I suppose you could theoretically get the output from any executable
>>
>>58143771
Yea there is a way to compile native node modules. Use the "bindings" npm module to help you get started.
>>
start coding
thinking about it doesn't produce any lines of code.
fucking hell kids these days are too afraid of making things.
>>
>>58143843
>>58143876
Cool, two good methods. Thank you
>>
The best way to build a RESTful API is to use ASP.NET Web API libraries.
>>
>>58143698
Is there a good established way to make a site with client-side rendering when you change the page but server-side rendering on the first load for crawlers, etc?
>>
>>58143915
Oh, come on.
Everything requires at least a little planning to succeed.
>>
File: wrong.gif (1MB, 480x287px) Image search: [Google]
wrong.gif
1MB, 480x287px
>>58144054
>wrong
>>
>>58144036
That's called a single page app and there are many ways to do it.

The best way imo is to load all of your templates/html on the first request, then use whatever means you want to toggle visibility on different components, giving the illusion they are switching pages.

When you "load" a new page you may have to make an AJAX or websocket call beforehand to get the data necessary to populate the template. When it's retrieved, the success callback should populate, then toggle visibility.
>>
>>58144036
>>58144169
If you're just wondering about web crawlers with a single page or AJAX based site then there is no good way to do it that I've seen. Have to bite the bullet somewhere.

You could make a normal site to begin with, then build AJAX rendering in (for non-bot users) when you're done creating the normal site. Check the request header, and if it's a bot, render your "normal" site with regular <a href=""> tags. If it's not a bot, then render the AJAX version.
Thread posts: 17
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.