Newbie question. My company has a webapp using Linux apache mysql php. Let's say the first step I'll start writing dart script, convert it to javascript. My question is: is it possible to replace the PHP SERVER SIDE code with dart (convert to js) while still using LAMP ? (some programs using php, some using js from dart)
2 Answers
Probably not.
First of all, dart:html can't be used on the server side. This may or may not be a problem in your case.
More importantly, LAMPP doesn't parse JavaScript - it's treated as a pure client language. You'd need an alternative that is able to parse JavaScript on the server side, for example node.js, but I don't think node.js will be able to parse your PHP scripts.
Another alternative: Run the Dart server in Dart's VM. You'd still need another port for it, but at least there is no need for the "JS server".
2 Comments
Dart can run on the server side and is considered an alternative to PHP. Although this isn't considered LAMP as LAMP stands for Linux Apache MySQL PHP (most cases).
Check out Aqueduct Dart REST Framework for a REST implementation.
Depending on the application you'll need to find a way for the apps to coexist. If the app is stateless it may be easier to shift users from PHP to Dart and back.