simov / express-admin

MySQL, MariaDB, PostgreSQL, SQLite admin for Node.js
MIT License
1.17k stars 223 forks source link

regarding express-admin setup #79

Closed gaurav1992 closed 9 years ago

gaurav1992 commented 9 years ago

I am very new for node.js and found this one example and try to run this but getting some error .

I have installed express-admin module and mysql module as well .

Then i go through with command tool and run the express-admin module after that it asked me to fill up

database detail like ..
database type : 
database name 
username
password 

i have putted there my xampp server detail after that it asked me to put admin log in detail .but i can not find out the log in detail of admin as well .

Before this i had run mysql module as well i am made a file mysql.js in my node directory and run it as mention in MYSQL module

var mysql      = require('mysql');
var connection = mysql.createConnection({
  host     : 'localhost',
  user     : 'root',
  password : ''
});
connection.connect();

connection.query('SELECT 1 + 1 AS solution', function(err, rows, fields) {
  if (err) throw err;

  console.log('The solution is: ', rows[0].solution);
});

connection.end();

it's run successfully but i am still confuse how could i call my database on chrome browser .I mean to say how can i see mysql dataabse on browser i have tried to run http://localhost:3000/ this link but it says webpage not available .

Let me know if i missed anything to write .

Waiting for your affirmative response

simov commented 9 years ago

The admin credentials are for logging to Express Admin, not your database. Try with user admin pass 11aaAA then navigate to localhost:3000

gaurav1992 commented 9 years ago

Hey Thanks @simov

Now after setting up config.json i have cope the same code as given for setting.json

"table_name": {
    "slug": "unique-slug",
    "table": {
        "name": "table_name",
        "pk": "pk_name",
        "verbose": "Verbose Name"
        // "schema": "name" // pg: set specific schema for this table only
    },
    "columns": [
        {...}, // see column definition below
        // { "manyToMany" ... } // see 'Many to Many' documentation
    ],
    "mainview": {
        "show": true
    },
    "listview": {
        "order": {
            "column_name1": "asc",
            "column_name2": "desc"
        },
        "page": 25,
        "filter": ["column_name1", "column_name2" ...]
    },
    "editview": {
        "readonly": false,
        // "manyToOne": { ... }, // see 'Many to One' documentation
        // "oneToOne": { ... } // see 'One to One' documentation
    }
}

but getting an error which is....

error jpg

Please suggest me what i have to do now .

Thanks

simov commented 9 years ago

You have to be very careful when editing JSON files. Use this http://jsonlint.com/ validator or a better editor that highlights the syntax errors.

Also take a look at the http://github.com/simov/express-admin-examples repository and the introductory screencast http://www.youtube.com/watch?v=1CdoCB96QNk

gaurav1992 commented 9 years ago

@simov I am using the same code as we have mention in document but it still says parse error in line 1.

Can you please help me to find out the error?

gaurav1992 commented 9 years ago

@simov thanks for your help .

It works for me the right one code for me is

{ "table_name": { "slug": "unique-slug", "table": { "name": "table_name", "pk": "pk_name", "verbose": "Verbose Name" }, "columns": [], "mainview": { "show": true }, "listview": { "order": { "column_name1": "asc", "column_name2": "desc" }, "page": 25, "filter": [ "column_name1", "column_name2" ] }, "editview": { "readonly": false } } }