| 1 | import Vue from "vue"; |
| 2 | import App from "./App.vue"; |
| 3 | import router from "./router"; |
| 4 | import { ajax } from "./utils/ajax"; |
| 5 | |
| 6 | Vue.config.productionTip = false; |
| 7 | |
| 8 | new Vue({ |
| 9 | router, |
| 10 | render: function(h) { |
| 11 | return h(App); |
| 12 | }, |
| 13 | created: function() { |
| 14 | //alert("test"); |
| 15 | ajax("http://localhost:3000/variants", "GET", variantArray => { |
| 16 | console.log("Got variants:"); |
| 17 | console.log(variantArray); |
| 18 | }); |
| 19 | }, |
| 20 | }).$mount("#app"); |
| 21 | |
| 22 | // TODO: get rules, dynamic import |
| 23 | // Load a rules page (AJAX) |
| 24 | // router.get("/rules/:vname([a-zA-Z0-9]+)", access.ajax, (req,res) => { |
| 25 | // const lang = selectLanguage(req, res); |
| 26 | // res.render("rules/" + req.params["vname"] + "/" + lang); |
| 27 | // }); |