Freelancer Profile Listing
-Template, Database access, Handler -Freelancer Database Table
This commit is contained in:
27
src/main.cpp
27
src/main.cpp
@ -8,10 +8,6 @@ using namespace std;
|
||||
|
||||
int main() {
|
||||
crow::SimpleApp app;
|
||||
//define your endpoint at the root directory
|
||||
CROW_ROUTE(app, "/")([]() {
|
||||
return "Hello world";
|
||||
});
|
||||
|
||||
// CROW_ROUTE(app, "/test.json")
|
||||
// ([](){
|
||||
@ -25,6 +21,29 @@ int main() {
|
||||
string databaseURI = "postgresql://cavecommadmin:cavecomm@localhost:5432/cavecomm";
|
||||
|
||||
|
||||
/*
|
||||
* Freelancer Profile listing for customers
|
||||
*/
|
||||
CROW_ROUTE(app, "/")
|
||||
([databaseURI]() {
|
||||
pqxx::connection databaseConnection(databaseURI);
|
||||
pqxx::result result = Database::executeStatement_SELECT_FREELANCERS_WITHCOMMISSIONSSTATE(databaseConnection);
|
||||
|
||||
auto page = crow::mustache::load("customerIndex_FreelancerListing.html");
|
||||
crow::json::wvalue resultJson = Database::convertResultToJSON(result, "freelancerProfiles");
|
||||
|
||||
crow::mustache::context ctx(resultJson);
|
||||
return page.render(ctx);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CROW_ROUTE(app, "/getEntry/<int>")
|
||||
([databaseURI](int entry) {
|
||||
pqxx::connection databaseConnection(databaseURI);
|
||||
|
Reference in New Issue
Block a user