javascript – Right structure, three-layered architecture webdevelopment

My question is have i gotten the three-layered architecture right with error handling etc. I have a webpage containing different resources. The code works but I am not sure if have structured it correct.

This is a function located in the BLL

    createPost: function (accountId, title, body, callback) {
        postValidator.validatePost(title, body, function (error) {
            if (error) {
                callback(error, null)
            } else {
                postRepository.createPost(title, body, accountId, function (error, postId) {
                    if (error) {
                        callback(new BusinessError(BusinessErrorType.DATA_LAYER_ERROR, "Error creating post"), null)
                    } else {
                        callback(null, postId)

Basically it sends a request to create desired post in the DL if the DL returns the error value the BLL will return it to the PL. My function in the PL that communicates with the BLL:“/new”, function (request, response) {

    const title = request.body.title
    const body = request.body.body
    const account = request.session.account
    loginManager.isLoggedIn(request.session.login, function (error, IsLoggedIn) {
        if (IsLoggedIn) {
            postManager.createPost(, title, body, function (error, createdPostId) {
                if (error) {
                    response.render("new-post.hbs", { title: title, body: body, notification: error.description, notificationType: "danger" })
                } else {
                    response.redirect("/posts/" + createdPostId)
        } else {
            response.render("accounts-sign-in.hbs", { notification: error.description, notificationType: "danger" })



Is this the correct way to go about?

WordPress, php laravel framework And Website Designer for $100

WordPress, php laravel framework And Website Designer

I am a web developer. I will design and develop a modern website. My experience enables me to create modern & responsive websites with high quality, professional look, and feel. I understand that every website that represents a business plays a very important role in its growth. That’s why I treat every website according to its nature with the following must-have features.

  • 100% Responsive website
  • Sliders with HD Images
  • Business website
  • Responsive & Mobile Friendly
  • Fastest Loading Time
  • Call to Actions Buttons
  • Image Galleries
  • Contact Forms
  • SEO Optimization
  • Social Media Integration like FB, Instagram, Twitter
  • Security Plugins
  • Call to Actions Buttons

Feel free to ask any questions.Please message me before placing the order.


Landing Page (WordPress)………… for $70

This Service includes:
-3 page
-Responsive Design
-Build From Scratch

by: Sakib10
Created: —
Category: WordPress
Viewed: 527


I will build wordpress website, wordpress design or landing page for $15

I will build wordpress website, wordpress design or landing page

Hi, I am Tanvier . I will create your WordPress Website or Landing page or re-design your website.In this website design Gig, You will get all of the following or Any :0. Installation of WordPress1. Create your full Clean, Elegant & Responsive WordPress design with Blog3. Responsive view on any mobile, tablet, and desktop4. Premium Slider Revolution for landing page5. Social Link Integration of your business6.Beautiful & Elegant Popups to attract visitor attention7. Any premium plugin customization / Setting up properly like membership or affiliate etc8. Transfer, DNS Propagation & Securing your new website9.Add e-commerce design and upload 20 products10.Speed up and also check performsAnything you are wanting more to build please let me know.I will do create anything you want on WordPress!Inbox me to discuss!ThanksTanvier


I will build your website by using wordpress within 3 days for $50

I will build your website by using wordpress within 3 days

Hello there,

Are you looking for a professional website builder for your portfolio, business or E-commerce business? Are you a start-up business person and you need a website for your business?

hey, then you are in the very right place.

I am offering you my services with good quality and a very renewable price. I have lots of experience in this field I want to offer you my services.

I am using WordPress for building a good looking website. I think if you here and read this you know about WordPress very well.WordPress is the leading CMS at this time. It’s easy to use and very user friendly.

You can contact me for free advice about your website plan. I am happy to help you.

Here are some services that I offer:

WordPress install on your hosting

Import demo data

customize theme as your requirements

create an e-commerce option for your products


let’s build your site with don’t have to worry about. I will take care of your wp website.

I have more services you can check my other gigs.

contact me before place an order it will help to understand each other

Thank you for visit here my friend

Be happy and stay safe


I will do HTML and CSS website design for $5

I will do HTML and CSS website design

You are great for checking my HTML and CSS service. For you to have checked this out it means that you have interest in my service and that you need a website that will be designed using HTML and CSS.

For your website design task and project. I am your perfect fit and i will always be of help and assitant to you. You can turn to me and be rest assured that you will not just get quality service from me but also on time delivery and maximum satisfaction.

Just share with me your idea or project and i will craft beautiful webiste for you using HTML and CSS.

Place your ORDER NOW!!! so that we can move on to the development state.