当前位置: 首页>NodeJS>ExpressJS>Application Structure for svg

Application Structure for svg

时间:2015-07-09 08:19 来源:网络整理 作者:KKWL 点击:
I want to create an application i.e svg-edit that use javascript for client side operations but I want to integrate it with ExpressJS. Task needed:1. User Authentication page2. After authentication depending on the user name the user is dir

I want to create an application i.e svg-edit that use javascript for client side operations but I want to integrate it with ExpressJS.

Task needed: 1. User Authentication page 2. After authentication depending on the user name the user is directed to the svg-edit page but the background image and the svg is the value from the database. 3. Auto saving and saving on close.

For this I have using ExpressJS and svg-edit 2.6.

My Approach: 1. I will create a page auth.html in /views of Expresss 2. Post the page and in the route handler authenticate it and then redirect to the svg-edit.html the whole folder with all its related .js files are put into /views so it will redirect it.

The porblem is that when server redirects i want to send the image location, username to the svg-edit.html page so that it changes the background w.r.t the value gained.

What is the best way to do such an operation.

Since I am new at ExpressJs so before writing the code. I need suggestion for the structure.

asked Nov 27 '13 at 17:58

Zeeshan
14

    

There are really lots of ways to do it ... I would load svg-edit async in a app window ... but this is just one of many solutions. –  rafaelcastrocouto Nov 27 '13 at 19:05

    

I want to use the MVC structure.. or the easiest way can you advice a way which is easy and on which i can easily change the background image of svg-editor on the basis of users from server –  Zeeshan Nov 28 '13 at 17:57

    

The problem is that the background of the svgedit can be changed from the javascript of the client side so how can i send the value from server after auth that can make my svg_edit.html dependent javascript value change –  Zeeshan Nov 28 '13 at 18:03

1  

as I said you can use an async ajax (api.jquery.com/category/ajax) or you can use websockets, they are faster but have less browser support(). You can also use good and old html forms. – 

    

ok thanks I will use ajax to fetch the data from server and mention the routes on express. I was confused with MVC structure that how it fits in the MVC structure. –  Zeeshan Nov 28 '13 at 18:45

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook. Browse other questions tagged or ask your own question.

顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------