How to run a Backbone js app? - javascript

I am very new to Backbone and MVC frameworks.I am learning backbone.js .
I have followed the tutorial http://code.tutsplus.com/tutorials/build-a-contacts-manager-using-backbonejs-part-1--net-24277
But i have no idea how to run it.I have really looked into many tutorials but i really couldn't find how to run this app!
This might be a very silly question and the solution might be very trivial to some of you,But i have no idea to how to run it!
I have downloaded the attachment http://cdn.tutsplus.com/net/uploads/legacy/1142_bb1/demo.zip
(from the same tutorial)
Now how do i host it on the server?

In case if someone is also facing the same issue :
Look at this question.
It tells how to serve a page on mac
In case the link is broken,here is the easiest solution from those answers
As of PHP 5.4.0, the CLI SAPI provides a built-in web server. More details >in the official PHP documentation:
1.Open terminal.
2.Navigate to the folder (directory) containing the file you want to serve.
3.php -S localhost:8080
4.Go to http://localhost:8080 in the browser.

Related

How to deploy a Next.js App on AWS using nginx

I'm currently following a tutorial on youtube on how to deploy a react app on AWS. He's using gitbash and nginx to do it. The problem is that currently I'm using a prebuilt template from themefor*st and the app they made includes next.js in it. Using this template, when I try to do "
npm run build" it does not provide me with an index.html file inside the build folder which is what the Youtube video tutorial points to, to run the front end on the AWS. I'm new to hosting a website but I think the problem lies in the /etc/nginx/sites-available/default configuration for the location. I look up answers on the internet but couldn't find anything helpful, closest so far are this documentation which I do not understand
https://nextjs.org/docs/advanced-features/static-html-export
I need help and if there are any questions regarding the file, I will try my best to explain them! Thank you
Here's the link to the youtube video I referred to above
https://www.youtube.com/watch?v=rE8mJ1OYjmM

Add NodeJS backend code to an Angular-seed based project

I recently abandoned the awesome LAMP solution for Node/AngularJS and I have some serious (and noob) difficulties to begin.
I took an existing AngularJS project based on Angular Seed and I didn't figure out how can I add some backend javascript code.
In online tutorials, I always find an app.js file, in which there is some "requires" and where I can add an extra server code. To launch this kind of project I have to node app.js
In my Angular-seed based project, there is only a package.json that contains script commands.
Also, I noticed that to launch it, I have to npm start.
Where can I put my NodeJS code in this project ?
Thanks in advance !
Usually you will have two differents projects. The backend (Nodejs) and the frontend (Angular). You can expose your backend logic using a public API that your frontend will use. For example you can expose a REST API using nodejs with help of express. I recommend you to take a look at swagger that can help you to define your api.
After that using your angular app you can send different requests to that API and consume the info that receive from it.
To sum up you will have two different projects. Hope this helps

Meteor new application structure is slow down development for ui folder

I have migrated my meteor 1.2.1 code base to meteor 1.3.0 and also moved all client code to imports/ui to utilize lazy loading feature for imports folder.
My problem is, If I am changing any client side file its restarting every time, which slows down development time in meteor 1.3.0 as I have to wait for building process.
Please provide your suggestion or best approach to overcome this issue.
As I have used Meteor 1.3.0 imports directory structure I have faced that issue but below are solution.
I am posting answer to my question as I have found reason why Meteor rebuilding my client side code, When I change any file.
Currently I am using /imports/ui/ for storing client side code. As you all know ui directory doesn't have any special purpose in Meteor build.
So, it assume this code as client or server code and rebuild and restart meteor app every time.
If you rename that folder/directory to client then it only refresh client side code not full app because client folder have special meaning in meteor.
Moreover now you can also use latest version of meteor which help to speed up startup building your app.
Hope this will help you solve problem.
Meteor 1.4.2 is been released in these days.
In the official forum they say: The big news is improved rebuild performance.
Maybe you should give a try.

MEAN.JS Cannot connect MongoDB

I am newbie here, starting to learn MEAN.JS, As I installed everything and tried to run
grunt --force
on the command line, it returns an error like the image below.
Im using windows here and also I already installed MongoDB on the C:/Program Files path. Thanks in advance! :)
Getting started with the MEAN stack might seem very daunting at first. You might think that there is too much new technology to learn. The truth is that you really only need to know “Javascript.” That’s right, MEAN is simply a javascript web development stack.
So, how do you actually get started developing on the MEAN stack?
The first step is to set up a project structure. I’ve found the following structure to make the most sense:
controllers/ db/ package.json server.js public/
This structure lets you keep the entire stack in a single project. Your AngularJS front end can go into the public folder while all your Express API logic goes into controller and your MongoDB collections and logic go into the db folder.
Now that you’ve set up a general project structure, you need to initialize your public folder as an Angular project. It is best to do this using a tool called Yeoman.
Yeoman is a toolkit that makes it easy for you to get started with a variety of Javascript frameworks and other web frameworks like Bootstrap and foundation. You can learn more about Yeoman at Yeoman.io.
Installing Yeoman is pretty straightforward.
You can read more here: http://www.citizentekk.com/mean-stack-tutorial-how-to-build-loosely-coupled-scalable-web-apps-nodejs-angularjs-applications/

Electron (Atom-Shell) Run unix command from link in page

I am trying to learn Electron (Atom-Shell) but I am finding it pretty tough to find documentation for it...
I am simply trying to figure out how to create a link with in index.html, and have it open a terminal window or run some sort of program.
I learn languages by learning specific tasks as I need them in a program, so that is why I am asking so then I can utilize the technique used in other ways in my programs.
Thank you for helping.
Well, essentially Electron is just a customised version of a Chromium browser that comes packaged with Nodejs and some really cool packages that basically allow you to run the custom browser as if it was a native platform application. Because of that creating an Electron app is very similar to creating a web-app that has a Nodejs back-end.
So to get started with a simple "Hello World!" app, you can just run the following npm...
npm install electron-prebuilt --save-dev
Once the npm is installed you'll need three files to run an Electron app.
A package.json file
A javascript file (default is main.js)
An html file (default is index.html)
See this GitHub repo for a quick copy/paste version of each and more detailed instructions: https://github.com/mafintosh/electron-prebuilt
after that you're ready to simply run your app...
$ electron .
Finally, one way to open a terminal window would be to use an onclick attribute in your html to trigger a child_process, found here, in a function.
That's it! You should be able to edit your html and javascript files as you would for any web-app, and take advantage of the added features that Electron provides.
I'd also check out these resources for more info:
A Quick Start intro to how Electron works -- https://github.com/atom/electron/blob/master/docs/tutorial/quick-start.md
The Atom discussion forum (Because Atom was built with Electron, and is made to be hackable, the community is quite active) -- https://discuss.atom.io/c/electron
A cool repo to keep up with the latest info. It includes links for apps that currently use Electron, tutorials, videos, and more --
https://github.com/sindresorhus/awesome-electron
I hope that helps!

Categories

Resources